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