import sys

t = int(sys.stdin.readline())
result = [0]*t

for i in range(t):
    n = int(sys.stdin.readline())
    num = [int(sys.stdin.readline().strip()) for _ in range(n)]

    print(num)
    for j in range()
    if (num[0]):
        result[i] = 'NO'
    else:
        result[i] = 'YES'

for i in result:
    print(i)
