#include using namespace std; typedef long long ll; ll gcd(ll n, ll m) { if (n > m) { ll copy = n; n = m; m = copy; } if (n == 0) { return m; } if (m%n == 0) { return n; } else { return gcd(m%n, n); } } int main() { ll n; cin >> n; int count = 0; ll d; queue q; q.push(n); do { n = q.front(); q.pop(); ll x = 2; ll y = 2; do { x = (x*x + 1) % n; y = (y*y + 1) % n; y = (y*y + 1) % n; d = gcd(abs(x - y), n); } while (d == 1); if (d < n) { q.push(d); q.push(n / d); count++; } } while (!q.empty()); count++; if (count >= 3) { cout << "YES" << endl; } else { cout << "NO" << endl; } return 0; }