#include #include using namespace std; bool ktnt(long long a) { long long j; if (a < 2) { return 0; } if (a < 4) { return 1; } for (j = 2 ; j <= ((long long) sqrt(a)) ; j++) { if (a % j == 0) { return 0; } } return 1; } int main() { #ifndef ONLINE_JUDGE freopen ("input.txt", "r", stdin); freopen ("output.txt", "w", stdout); #endif long long temp,n,i; scanf("%ld\n",&n); for (i = 1 ; i <= n ; i++) { scanf("%ld ",&temp); if (ktnt((long long) sqrt(temp))) { printf("%s\n","YES"); } else { printf("%s\n","NO"); } } return 0; }