Given an array A. Is there any subset of array A in which if we do AND of all elements of that subset then output should be in power of two (for example : 1,2,4,8,16 and so on ).    

Input: 
First line contains number of test cases T. Each test first line contains N size of array A and next line contains N space separated integers.  

Output: 
For each test case print YES if there is any subset of array A in which if we do AND of all elements of that subset then output should be in power of two else print NO.  

Constraints: 
1 ≤ T ≤ 1000 
1 ≤ N ≤ 200 
0 ≤ Ai ≤ 10^9

SAMPLE INPUT
2
3
1 2 3
2
10 20SAMPLE OUTPUT
YES
NO
from itertools import combinations
t=int(raw_input())
for s in range(t):
    n = int(raw_input())
    a = map(int, raw_input().split())
    ans = "NO"
    if any(bin(i).count("1") == 1 for i in a):
    	ans = "YES"
    else:   
        for i, j in combinations(a, 2):
            if bin(i & j).count("1") == 1:
                ans = "YES"
                break
    if ans == "NO" and len(a) >= 3:
    	for i, j, k in combinations(a, 3):
    		if bin(i&j&k).count("1") == 1:
    			ans = "YES"
    			break
    print ans