#include "bits/stdc++.h" #define ALL(a) (a).begin(),(a).end() #define SORT(c) sort((c).begin(),(c).end()) #define DESCSORT(c) sort(c.begin(), c.end(), greater()) using namespace std; using LL = long long int; using LD = long double; using pii = pair; using pll = pair; using pdd = pair; using vi = vector; using vvi = vector; using vvvi = vector; using vl = vector; using vvl = vector; using vvvl = vector; using vd = vector; using vvd = vector; using vs = vector; using vb = vector; using vvb = vector; int gcd(int x, int y) { return y ? gcd(y, x % y) : x; } LL gcd(LL x, LL y) { return y ? gcd(y, x % y) : x; } int i, zero, one, two, three; bool isPrime(int n) { if (n == one) { return false; } else if (n == two) { return true; } if (n % two == zero) { return false; } for (int i = three; i * i <= n; i += two) { if (n % i == zero) { return false; } } return true; } int main() { one++; two++; two++; three++; three++; three++; int n; cin >> n; cout << (isPrime(n) ? "YES" : "NO") << endl; }