Binary army ants are preparing for a cruel war, but things become more complicated than they thought.
There are n ants in the squad. Originally, each army ant i(1≤i≤n) has its power ai .
However, it turns out something strange will happen during the war: a random pair (i,j)(1≤i<j≤n) will be chosen, and the ant i and the ant j will disappear, and a new ant with power ai⊕aj, which is the bitwise exclusive OR (XOR) of ai and aj, will magically appear.
This kind of thing is so rare that it happens at most once throughout the war.
The ants think the total strength of the whole squad is i=1∑n2ai , and the squad is called bitwise perfect if the event above could never decrease its strength.
Too busy practicing, ants don't have enough time to check whether the squad is bitwise perfect. Can you help them with this? There can be T squads.
输入格式
Each test contains multiple test cases. The first line contains the number of test cases T(1≤T≤105) .
Each test case consists of two lines.
The first line contains one integer n(2≤n≤5×105), the number of ants in the squad.
The second line contains nnn integers a1,a2,…,an(1≤ai≤1018), the power of each ant.
It is guaranteed that ∑n over all test cases in one test will not exceed 5×105.
输出格式
For each test case, output "YES" if the squad is bitwise perfect and "NO" otherwise. You can print the answer in any case.
输入样例
复制
3
2
3 5
4
1 2 4 8
3
1 2 3
输出样例
复制
YES
YES
NO
数据范围与提示
In the first case, if the two ants merge, as 3⊕5=6, the total strength of the whole squad changes from 23+25=40 to 26=64, so the event will not decrease the total strength. So the squad is bitwise perfect.