#include <iostream>
#include <fstream>
#include <cmath>


using namespace std;


int main()
{ ifstream f("snton.inp");
int n;
f>>n;
f.close();
ofstream f1("snton.out");
int ok=0,i;
if (n==0) {f1<<"NO";}
if (n==1) {f1<<"NO";}
if (n==2) {f1<<"YES";}

 for (i=2;i*i<=n;i++)
  {  if (n%i==0)
    {ok =1;
    break;}}
 if (ok==0)
{f1<<"YES";}
else f1<<"NO";
f1.close();
return 0;
}
