#include <iostream>
#include<fstream>
using namespace std;
int main()
{
	int n;
	int x=0;
	ifstream f1("snton.inp");
	f1>>n;
	f1.close();
	for(int i=2;i*i<=n;i++)
	{
		if(n%i==0)
		
		{cout<<"NO";x++;break;};
	}
	ofstream f2("snton.out");
	if(x==0) f2<<"YES";
	if(x==1) f2<<"NO";
	f2.close();
	return 0;
}
