Permutation Compression

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Grammy has a permutation of length nn. She wants to delete some useless elements in the permutation, so she decided to use some magic tool to delete them. There are kk magic tools, the ii-th of them can delete the maximum element of an interval of length exactly _i\ell\_i. Each magic tool can be used at most once.

After each deletion, the length of the array decreases by one, and the neighbors of the deleted element become neighbors themselves.

Before using the tool, Grammy shows you her blueprint of the array after deletion. The new array consists of exactly mm distinct elements from 11 to nn. Please help Grammy to determine whether it is possible to delete the elements by using the magic tool, so that the result is equal to the blueprint.

입력

There are multiple test cases.

The first line contains an integer TT (1T1051 \leq T \leq 10^5), denoting the number of test cases.

For each test case:

The first line contains three integers nn, mm, kk (1mn21051 \leq m \leq n \leq 2 \cdot 10^5, 1k21051\leq k\leq 2\cdot 10^5), denoting the length of the permutation, the length of the compressed array, and the parameter of the magic tool.

The second line contains nn distinct integers a_ia\_i (1a_in1 \leq a\_i \leq n), denoting the initial permutation. It is guaranteed that the elements are distinct.

The third line contains mm distinct integers b_ib\_i (1b_in1 \leq b\_i \leq n), denoting the array after compression. It is guaranteed that the elements are distinct.

The fourth line contains kk integers _i\ell\_i (1_in1 \leq \ell\_i \leq n), denoting the magic tools.

It is guaranteed that n2105\sum n\leq 2\cdot 10^5 and k2105\sum k\leq 2\cdot 10^5.

출력

For each test case, output "YES" or "NO" on a separate line, denoting the answer to the problem.