#include <fstream>
#include <cmath>

using namespace std;

bool TestPrime(long long n){ int k=0;
  if(n<2){return false;}
  if(n==2){return true;}
  for (int i=3;i<=sqrt(n);i+=2){
    if (n%i==0){k=1;break;}
  }
  if (k==0){return true;}
  else {return false;}
}

int main(){
 long long n;
 ifstream fi;
 fi.open("D:/snton.inp");
 fi>>n;
 ofstream fo;
 fo.open("snton.out");
 if (TestPrime(n)==true){fo<<"YES";}
 else {fo<<"NO";}
}
