#include <iostream>
#include <algorithm>
using namespace std;
const int N = 110;
bool is_prime(int x){
int n;
if(x < 2 ) return false;
for(int i = 2; i <= x / i ; i++)//i^2小于等于x就行了
if(x % i == 0)
return false;
return true;
}
int main(){
int n;
cin >> n ;
while(n--){
int x;
cin >> x;
if(is_prime(x)) puts("Yes");
else puts("No");
}
return 0;
}