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