#include <bits/stdc++.h>
#include <ext/rope>
using namespace std;
using namespace __gnu_cxx;
typedef long long ll;
const ll MAXN = 1e5 + 100;

#define x first
#define y second
map<string, bool> m;
bool pr(int n) {
    for (int i = 2; i * i <= n; ++i)
        if (n % i == 0)
            return false;
    return true;
}
int main() {
    int n;
    cin >> n;
    cout << (pr(n) == 1 ? "YES" : "NO");
    return 0;
}
