#include <iostream>
#include <fstream>
using namespace std;
int main()
{
	ifstream fi("sontn.inp");
		int n ;
	fi >> n;
	fi.close();
	ofstream fo("sontn.out");
		int i = 1;
	if (n == 1)
	{
		fo << "NO";
	}
	else
		if (n == 2)
		{
			fo << "YES";
		}
	for (int m = 2; m*m <= n; m++)
	{
		if (n%m == 0)
		{
			i = 0;
			break;
		}
	}
	if ((i == 1)&&(n!=1)&&(n!=2))
		fo << "YES";
	else
	if((n!=1)&&(n!=2) &&(i==0))
		fo << "NO";
		fo.close();
		return 0;
}


