#include using namespace std; using ll=long long; #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() template bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;} template bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;} int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int Q; cin>>Q; vectorflag(100001,true); flag[1]=false; for(int i=2;i<=100000;i++){ if(!flag[i])continue; for(int j=2*i;j<=100000;j+=i){ flag[j]=false; } } vectorP; for(int i=2;i<=100000;i++){ if(flag[i]){ P.push_back(i); } } while(Q--){ ll A; cin>>A; int cnt=0; for(auto x:P){ if(x>A)break; if(A%x==0){ while(A%x==0){ cnt++; A/=x; } } } if(A>1)cnt++; if(cnt==3)cout<<"Yes\n"; else cout<<"No\n"; } }