#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll n;
cin >> n;
int pri[10] = {3,5,7,11,13,17,19,23,29,31};
if(n<2){
cout << "NO";
} else if(n==2 || n==31){
cout << "YES";
}else if(n%2==0 && n!=2){
cout << "NO";
} else if(n%5 == 0 && n!=5){
cout <<"NO";
} else{
for(int i=0 ; i<10 ; i++){
if(n%pri[i]==0 && pri[i]!=n){
cout << "NO";
break;
} else if(n%pri[i] != 0 && i==9 ){
cout << "YES";
}
}
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgbGwgbG9uZyBsb25nCgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CiAgICAjaWZuZGVmIE9OTElORV9KVURHRQogICAgICAgIGZyZW9wZW4oImlucHV0LnR4dCIsInIiLHN0ZGluKTsKICAgICAgICBmcmVvcGVuKCJvdXRwdXQudHh0IiwidyIsc3Rkb3V0KTsKICAgICNlbmRpZgogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbygwKTsKICAgIGNpbi50aWUoMCk7CiAgICBjb3V0LnRpZSgwKTsKCiAgICBsbCBuOwogICAgY2luID4+IG47CiAgICBpbnQgcHJpWzEwXSA9IHszLDUsNywxMSwxMywxNywxOSwyMywyOSwzMX07CiAgICBpZihuPDIpewogICAgICAgIGNvdXQgPDwgIk5PIjsKICAgIH0gZWxzZSBpZihuPT0yIHx8IG49PTMxKXsKICAgICAgICBjb3V0IDw8ICJZRVMiOwogICAgfWVsc2UgaWYobiUyPT0wICYmIG4hPTIpewogICAgICAgIGNvdXQgPDwgIk5PIjsKICAgIH0gZWxzZSBpZihuJTUgPT0gMCAmJiBuIT01KXsKICAgICAgICBjb3V0IDw8Ik5PIjsKICAgIH0gZWxzZXsKICAgICAgICBmb3IoaW50IGk9MCA7IGk8MTAgOyBpKyspewogICAgICAgICAgICBpZihuJXByaVtpXT09MCAmJiBwcmlbaV0hPW4pewogICAgICAgICAgICAgICAgY291dCA8PCAiTk8iOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIH0gZWxzZSBpZihuJXByaVtpXSAhPSAwICYmIGk9PTkgKXsKICAgICAgICAgICAgICAgIGNvdXQgPDwgIllFUyI7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CgoKICAgIHJldHVybiAwOwp9Cg==