#include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main(){ ll n, p, t; cin >> n; t = pow(n, 0.5); vector is_prime(t, 1); is_prime[0] = 0; is_prime[1] = 0; for (ll i = 2; i < t; i++){ for(ll j = i*i; j < t; j += i) is_prime[j] = 0; } for (ll i = 2; i < t; i++){ if ((is_prime[i]) && !(n%i)){ p = i; while (n){ if (!(n%p)) n /= p; else break; } break; } } if (n == 1){ cout << "Yes" << endl; return 0; } for (ll i = p + 1; i < pow(n, 0.5); i++){ if ((is_prime[i] = 1) && !(n%i)){ p = i; while (n){ if (!(n%p)) n /= p; else break; } break; } } if (n == 1){ cout << "Yes" << endl; return 0; } cout << "No" << endl; }