#include <iostream>
#include <fstream>
using namespace std;
int main()
{
    ifstream f1("snton.inp");
    int n;
    f1>>n;
    f1.close();

int kiemTraSoNguyenTo(int n)
{
  bool flag = false;

  for(int i = 2; i <= n/2; ++i)
  {
      if(n%i == 0)
      {
          flag = true;
          break;
      }
  }
  return flag;

    ofstream f2("snton.out");
    if(kiemTraSoNguyenTo(n)==0)
    f2<<"YES";
    else
    f2<<"NO";
    f2.close();
    return 0;
}
}
