#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 (IsPrime(n) || n == 1 || n % 2 != 0 || n % 3 != 0) cout << "NO" << endl; else cout << "YES" << endl; return 0; }