#include using namespace std; int main(){ int q;cin>>q; vector a(100001,1); vector b; for(int i=2;i<=400;i++){ if(!a[i])continue; for(int j=i*i;j<=100000;j+=i){ a[j]=0; } b.push_back(i); } while(q--){ long long n;cin>>n; int ct=0; for(auto i:b){ while(n%i==0){ ct++; n/=i; if(ct>=3)break; } if(ct>=3)break; } if((ct==3&&n==1)||(ct==2&&n>1))cout<<"Yes\n"; else cout<<"No\n"; } }