#include<bits/stdc++.h>
#define NAME "snton."
using namespace std;
ifstream fi(NAME"inp");
ofstream fo(NAME"out");
int kt(int x){
if(x<2)return 0;
else{

    bool k=true;
    for(int i=2;i<=trunc(sqrt(x));i++)if(x%i==0){k=false;break;}
    if(k)return 1;
    else return 0;

}
}
int main(){
int n;
fi>>n;
if(kt(n))fo<<"YES";
else fo<<"NO";
}
