#27683: _CPP


11030067@mail.hpsh.tp.edu.tw (和平110級鄧雨珊)


#include <iostream>
#include <cmath>
using namespace std;

int main(){
int n, x, root;
bool prime;
cin >> n;
while (n--){
cin >> x;
root=sqrt(x);
prime=true;
for (int i=2; i<=root; i++){
if (x%i==0){
prime=false;
}
}
prime ? cout <<"Y\n" : cout <<"N\n";
}
}