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