#include <iostream>
#include <fstream>

using namespace std;

int main()
{
	ifstream input;
	ofstream output;
	int n;
	input.open("snton.inp");
	input >> n;
	int count = 0;
	for (int i = 1; i <= n; i++)
	{
		if (n % i == 0)
		{
			count++;
		}
	}
	input.close();
	output.open("snton.out");
	if (count == 2)
	{
		output << "YES";
	}
	else
	{
		output << "NO";
	}
	output.close();
	return 0;
}