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
def power2(val):
	if (val != 0) and((val & val-1) == 0):
		return True
	return False
             
t = int(raw_input())
for i in xrange(t):
    n = int(raw_input())
    arr = map(int , raw_input().split())
    total = 0
    for i in range(32):
    	total += (1 << i)
    if n == 1:
    	if power2(arr[0]):
    		print "YES"
    	else:
    		print "NO"
    else:
    	flag = 0
    	for i in range(32):
    		ans = total
    		for j in range(n):
    			if arr[j] & (1 << i):
    				ans = ans & arr[j]
    		if power2(ans):
    			flag = 1;
    			break
    	if flag :
    		print "YES"
    	else:
    		print "NO"