#include<fstream>
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
	int n,c=0;
	ifstream f1; f1.open("snton.inp");
	f1>>n;
	f1.close();
	if(n>2){for(int b=2;b<=sqrt(n);b++)
    {
        if(n%b==0) {c=1;break;}
    }
    ofstream f2; f2.open("snton.out");
    if(c==0){f2<<"YES";}
    else f2<<"NO";
    f2.close();
    }
    ofstream f2; f2.open("snton.out");
    if(n=2)f2<<"YES";
    if(n<2)f2<<"NO";
    f2.close();
}
