long a;i,j;main(t){for(t+=scanf("%ld",&a);t--;)for(i=1,j=sqrt(a);i++j?a:i););a=!puts(a>1?"YES":"NO");}