A. Are They the Same?
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You are given two integer arrays $$$a$$$ and $$$b$$$, each of length $$$n$$$. Furthermore, you are given an integer $$$k$$$.

You are allowed to perform any of the following operations zero or more times:

  • Choose an index $$$i$$$ ($$$1\le i\le n$$$) and set $$$a[i] := 2\cdot a[i] + k$$$.
  • Choose an index $$$i$$$ ($$$1\le i\le n$$$) and set $$$a[i] := a[i] + 2$$$.
  • Choose an index $$$i$$$ ($$$1\le i\le n$$$) and set $$$a[i] := a[i] - 2$$$.

Determine if there is a way to apply these operations such that the resulting array $$$a$$$ is a permutation$$$^{\dagger}$$$ of $$$b$$$. Note that there are no restrictions on the values of the array during the process: elements may become negative or arbitrarily large.

$$$^{\dagger}$$$An array $$$a$$$ is a permutation of an array $$$b$$$ if $$$a$$$ consists of the elements of $$$b$$$ in arbitrary order. For example, $$$[4,2,3,4]$$$ is a permutation of $$$[3,2,4,4]$$$, while $$$[1,2,2]$$$ is not a permutation of $$$[1,2,3]$$$.

Input

Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). The description of the test cases follows.

The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1\le n\le 100$$$, $$$0\le k\le 10^6$$$) — $$$n$$$ is the length of $$$a$$$ and $$$b$$$.

The second line of each testcase contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^6$$$).

The third line of each testcase contains $$$n$$$ integers $$$b_1, b_2, \ldots, b_n$$$ ($$$0 \le b_i \le 10^6$$$).

Output

For each test case, print "YES" if it is possible to transform $$$a$$$ into a permutation of $$$b$$$, and "NO" otherwise.

You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses.

Example
Input
5
3 4
1 2 7
5 3 8
1 1
0
1
1 1
1
0
6 1
0 0 0 0 0 0
1 3 7 15 31 63
2 1000000
999999 1
1000000 1
Output
YES
YES
NO
YES
YES
Note

In the first test case, consider applying the following operations:

  • Apply $$$a[1] := a[1] + 2$$$
  • Apply $$$a[2] := 2 \cdot a[2] + k$$$
  • Apply $$$a[3] := a[3] - 2$$$
As a result of these operations, $$$a$$$ becomes $$$[3, 8, 5]$$$, which is a permutation of $$$[5, 3, 8]$$$.

In the second test case, we can apply the operation $$$a[1] := 2\cdot a[1] + k$$$ to make $$$a = [1]$$$.

In the third test case, we can show that there is no way to make $$$a = [0]$$$.