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