#include <bits/stdc++.h>
using namespace std;
bool ggs(int y){
for (int i = 1; i*i <= y; i++){
for (int j = 1; j*j <= y; j++){
if (i*i+j*j == y){
return true;
}
}
}
return false;
}
int main(){
int n;
cin >> n;
int x;
for (int i = 1; i <= n; i++){
cin >> x;
if (ggs(x) == true){
cout << "Yes";
} else {
cout << "No";
}
}
return 0;
}