#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while (t--){
int a;
bool x = 0;
cin >> a;
for (int i = 0; i <= a; i++){
int j = sqrt(a-i*i);
if (j*j + i*i == a){
x = 1;
break;
}
}
if (x == 1){
cout << "Yes" << endl;
}else{
cout << "No" << endl;
}
}
}