#include<iostream>
#include<cstring>
#include<string>
using namespace std;
int n, x;
int main() {
cin >> n;
while (n -- ) {
string s;
cin >> x;
if (x < 2) {
s = "No";
}
else {
for (int i = 2; i <= x / i; i ++ ) {
if (x % i == 0) {
s = "No";
}
}
if (s != "No") s = "Yes";
}
cout << s << endl;
}
}