#include <iostream>
#include <cmath>
#include <stdio.h>
#define LL __int64
using namespace std;
bool ss(LL a)
{
LL i;
for(i=2;i*i<=a;i++)
{
if(a%i==0)
return true;
}
return false;
}
int main()
{
int t;
LL m,s;
scanf("%d\n",&t);
while(t--)
{
scanf("%I64d",&m);
//cin>>m;
s=(LL)sqrt(m+0.5);
if(s*s!=m)
printf("NO\n");
else
if(ss(s)==true||m==1) printf("NO\n");
else
printf("YES\n");
}
return 0;
}
如果一个数有三个约数就输出yes。。。。