#include <bits/stdc++.h>
using namespace std;

int main() {
    vector<bool>  f(14);
    f[0]=true;
    for(int i=0;i<14;i++){
        if(f[i]){
            for(int j=1;i+j*j-1<14;j++){
                f[i+j*j-1]=true;
            }
        }
    }
    int T;
    long long x;
    cin>>T;
    while(T--){
        cin>>x;
        x--;
        if(x>=14||f[x]){
            cout<<"Yes\n";
        }else {
            cout<<"No\n";
        }
    }
}
// 64 位输出请用 printf("%lld")