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
T = int(raw_input())
while T:
  flag=False
  N = int(raw_input())
  arr = [int(i) for i in raw_input().split()]
  ok=False
  for i in xrange(32):
    first=True
    mul=0
    for j in xrange(len(arr)):
      
      if 1&(arr[j]>>i):
        if first:
          mul = arr[j]
          first = False
        else:
          mul = mul & arr[j]
      if bin(mul).count('1')==1: 
      	ok=True
  if ok:
  	print "YES"
  else:
  	print "NO"
 
  T -= 1