#include #include using namespace std; #define fastcin {\ cin.tie(0);\ ios::sync_with_stdio(false);\ } #define rep(i, a, b) for(int i = a; i < b; ++i) #define scan(x) cin >> x #define print(x) cout << x << "\n" int main() { fastcin; long N; scan(N); auto sq = (int)sqrt(N); bool flag = false, p[sq+1]; int k; rep(i, 2, sq+1) p[i] = true; rep(i, 2, sq+1) { if (p[i]) { k = i; while (k!=N && !(N%k)) { if (flag) { print("YES"); return 0; } flag = true; k *= k; } for (int j = i<<1; j < sq+1; j+=i) p[j] = false; } } print("NO"); return 0; }