ZZX has a sequence of boxes numbered 1,2,…,n. Each box can contain at most one ball.
You are given the initial configuration of the balls. For 1≤i≤n, if the i-th box is empty, then a_i=0, otherwise the i-th box contains exactly one ball, the color of which is a_i, a positive integer. Balls of the same color cannot be distinguished.
ZZX will perform m operations in order. During i-th operation, he collects all the balls from boxes l_i,l_i+1,…,r_i−1,r_i, and then arbitrarily puts them back into these boxes. Note that each box should always contain at most one ball.
ZZX wants to change the configuration of the balls from a_1,a_2,…,a_n to b_1,b_2,…,b_n using these operations. Please tell ZZX whether it is possible to achieve his goal.
The first line contains an integer T≤60. Then T test cases follow. In each test case:
The first line of the test case contains two integers n and m (1≤n≤1000, 0≤m≤1000, sum of n over all test cases does not exceed 2000, sum of m over all test cases does not exceed 2000).
The second line contains a_1,a_2,…,a_n (0≤a_i≤n). The third line contains b_1,b_2,…,b_n (0≤b_i≤n). Each of the next m lines contains two integers l_i and r_i (1≤l_i≤r_i≤n).
For each test case, print "Yes" or "No" on a separate line.