409338: GYM103486 E Great Detective TJC

Memory Limit:256 MB Time Limit:0 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

E. Great Detective TJCtime limit per test0.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Recently, Detective TJC received a commission. In order to complete the task, he needs to solve a puzzle:

Given an array $$$A$$$ consisting of $$$N$$$ positive integers $$$A_1, A_2, \ldots A_n$$$, you need to find $$$2$$$ distinct indices $$$i, j(i \neq j)$$$, such that $$$A_i \oplus A_j = 1$$$, where $$$\oplus$$$ denotes the bitwise XOR operation. The bitwise XOR is a binary operation that takes two bit patterns of equal length and performs the logical exclusive OR operation on each pair of corresponding bits. The result in each position is $$$1$$$ if only one of the bits is $$$1$$$, but will be $$$0$$$ if both are $$$0$$$ or both are $$$1$$$. For example: $$$10(1010_{2}) \oplus 12(1100_{2}) = 6(0110_{2})$$$.

However, TJC doesn't like to find anything in chaotic numbers, because it reminds him of his bedroom. So he comes to ask you for help. You just need to tell him if there is an answer.

Input

The first line contains an integer $$$T (1 \leq T \leq 100)$$$, indicating the number of test cases you need to solve.

The first line of each test case contains an integer $$$N (1 \le N \le 10^{5})$$$, indicating the number of elements in the array. The next line contains $$$N$$$ space-separated integers $$$A_1, A_2, \ldots A_n (1 \leq A_i \leq 10^{9})$$$, indicating the elements of the array $$$A$$$.

It is guaranteed that the sum of $$$N$$$ over all test cases does not exceed $$$5 \times 10^{5}$$$.

Output

For each test case, if there exists $$$2$$$ distinct indices $$$i, j$$$ such that $$$A_i \oplus A_j = 1$$$, output "Yes". Otherwise, print "No" (no quotes).

ExampleInput
2
4
5 1 3 4
2
5 6
Output
Yes
No

加入题单

上一题 下一题 算法标签: