list=[]
n=int(input())
for i in range(n):
    list.append(int(input()))
for i in list:
    num=i
    result=0
    for x in range(1,int((num/2)**0.5)+1):
        if num-x**2==(int((num-x**2)**0.5))**2:
            print("YES")
            result=1
            break
    if result==0:
        print("NO")