#include<iostream>
using namespace std;
int main()
{
int n;
bool c=1;
cin >> n;
if (n <= 1)
{
cout << "NO
";
}
else
{
for (int i = 2; i < n; i++)
{
if (n % i == 0)
{
c=0;
break;
}
}
if (!c)
cout << "NO
";
else
cout << "YES
";
}
return 0;
}