#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 dem=0,i;
 for (i=1;i<=n;i++)
  {  if (n%i==0)
    dem++;}
 if (dem==2)
{f1<<"YES";}
else f1<<"NO";
f1.close();
return 0;
}
