You are given two arrays and , both consisting of non-negative integers. You can perform the following operation on the array an arbitrary number of times (possibly, zero):
First, you select a permutation of ;
Then, for each , you set to . Here, denotes the bitwise AND operation.
You have to determine whether it is possible to transform into .
输入格式
The input consists of multiple test cases. The first line contains an integer (), the number of test cases. For each test case:
The first line contains a single integer (), which is the length of arrays and .
The second line contains integers (), which are the elements of .
The third line contains integers (), which are the elements of .
It is guaranteed that the sum of over all test cases does not exceed .
输出格式
For each test case, print in a single line if it is possible to transform into . Otherwise, print .
You can output the answer in any case (upper or lower). For example, the strings , , , and will be recognized as positive responses.
In the first test case, we need to use at least one operation to transform into . Note that is always because . However, , so it is impossible to make , no matter how the permutations are selected during the operations.
In the second test case, you can select . After this operation, is transformed into .
In the third test case, , so we do not need any operations.