#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int Ac;
cin>>Ac;
for(int i=1;i<=Ac;i++){
int n,m,a=0;
cin>>n;
while(n>1){
m=2;
while(n%m!=0)
m++;
n/=m;
if(m%2!=0){
a+=0;
}
else{
a++;
}
}
if(a==0){
cout<<"Yes"<<endl;
}
else{
cout<<"No"<<endl;
}
}
return 0;
}