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