#include<bits/stdc++.h> using namespace std; int main(){ int T,n ; cin>>T; bool a =true ; for(;T>0;T-=1){ cin>>n; if(n==1){ cout<<"No"<<'\n'; } else{ for (int i =2;i<n;i+=1){ if (n%i==0){ a =false ; break ;} else{ a=true ; } } if(a==true ){ cout<<"Yes"<<'\n'; } else{ cout<<"No"<<'\n'; }}} return 0;}