#include #include using namespace std; // vector struct theSieveOfEratosThenes { vector prm; theSieveOfEratosThenes(int n) { prm = vector(n + 1, true); prm[0] = prm[1] = false; for (int i = 2; i * i <= n; ++i) { if (prm[i]) { for (int j = 2 * i; j <= n; j += i) prm[j] = false; } } } bool isPrime(int a) { return prm[a]; } }; template bool trialDivision(T a) { if (a == 1) return false; T i; for (i = 2; i * i <= a; ++i) { if (a % i == 0) break; } if (a < i * i) return true; return false; } int main() { long N, i; cin >> N; theSieveOfEratosThenes tsoet(10000000); for (i = 2; i * i <= N; ++i) { if (N % i == 0 && (!tsoet.isPrime(i) || !trialDivision(N / i))) break; } if (N < i * i) cout << "NO"; else cout << "YES"; }