#include <iostream>
using namespace std;
bool isPrime(int n)
{
if (n < 2) return false;
int bound = (int)sqrt(1.0*n);
for (int i = 2; i <= bound; i++)
{
if (n % i == 0) {
cout << "no";
return false;
}
}
cout << "YES";
return true;
}
int main()
{
while (true) {
int n;
cin >> n;
isPrime(n);
}
}