#include int main(){ long long N,i=2; scanf("%lld",&N); for(;i*i<=N;i++)if(N%i==0)break; puts(i*i>N ? "NO" : "YES"); return 0; }