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
import math
t = int(raw_input())
while t:
	flag=0
	n = int(raw_input())
	arr = [int(i) for i in raw_input().split()]
	item = max(arr)
	if item==0:
		print 'NO'
		t-=1
		continue
	l = int(math.log(item,2))
	for i in range(l+1):
		bm = 1<<i	##i'th bit set
		cm = -1		## all bit set
		for ele in arr:
			if bm&ele:
				if cm==-1:
					cm = ele
				else:
					cm = cm&ele
		if cm == bm:
			flag=1
			break
	if flag:
		print 'YES'
	else:
		print 'NO'
	t-=1