#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
bool check(int num)
{
if(num <2) return false;
for(int i=2;i<=num/i;i++)
{
if(num%i==0)return false;
}
return true;
}
int n;
int main()
{
cin>>n;
while(n--)
{
int num;
cin>>num;
if(check(num)) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return 0;
}