#include using namespace std; using ll = long long; using ull = unsigned long long; #ifndef __MACRO_H__ #define __MACRO_H__ #define all(collection) (collection).begin(), (collection).end() // begin to end #define rep(i, begin, end) for (ll i = begin; i < end; i++) // repeat #define repr(i, begin, end) for (ll i = begin; end < i; i--) // repeat reverse #endif bool IsPrime(int num) { if (num < 2) return false; else if (num == 2) return true; else if (num % 2 == 0) return false; // 偶数はあらかじめ除く double sqrtNum = sqrt(num); for (int i = 3; i <= sqrtNum; i += 2) { if (num % i == 0) { // 素数ではない return false; } } // 素数である return true; } int main(void) { ll n; cin >> n; if (n == 1) { cout << "NO" << endl; return 0; } ll lc = (ll)sqrt(n) + 1; rep(i, 2, lc) { if (n % i == 0) { if (!IsPrime(n / i)) { cout << "YES" << endl; return 0; } } } cout << "NO" << endl; return 0; }