#include <iostream>
#include <fstream>

using namespace std;

int main()
{
    ifstream a;
    ofstream b;
    a.open("snton.inp");
    int i;
    a >> i;
    a.close();
    b.open("snton.inp");
    if (i == 2) b << "YES";
    else
    {
        for (int n = 2; n <= i/2; n++)
        {
            if (i%n==0) {b << "NO";return 0;}
        }
        b << "YES";
    }
    return 0;
}
