#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
	ifstream f("snton.inp");
	ofstream f1("snton.out");
int main()
{
  bool snt = true;
  int N;
	f>>N;
  for(int64_t i = 2; i <= N/ 2; ++i)
  {
      if(N % i == 0)
      {
          snt = false;
          break;
      }
  }
  if (snt)
      f1 <<"YES";
  else
      f1 << "NO";


	return 0;

}
