#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) #define all(c) (c).begin(), (c).end() #define zero(a) memset(a, 0, sizeof a) #define minus(a) memset(a, -1, sizeof a) template inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); } template inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); } typedef long long ll; int const inf = 1<<29; void ng() {cout << "NO\n";exit(0);} void ok() {cout << "YES\n"; exit(0);} namespace math { namespace prime { constexpr int Max = 1e7+1; // !!!INPUT MAX NUMBER!!! int prime[Max]; bool is_prime[Max]; int sieve(int n) { int prime_count = 0; rep(i, n+1) is_prime[i] = 1; is_prime[0] = is_prime[1] = 0; REP(i, 2, n+1) { if(!is_prime[i]) { continue; } prime[prime_count++] = i; for(long long j=(long long)i*i; j<=n; j+=i) { is_prime[j] = 0; } } return prime_count; } } #define USE_PRIME_SIEVE \ using math::prime::prime; \ using math::prime::is_prime; \ using math::prime::sieve; } USE_PRIME_SIEVE int main() { ll N; cin >> N; sieve(sqrt(N+1)); set st; for(int i=2; (ll)i*i<=N; i++) { if(is_prime[i] && N % i == 0 && !is_prime[N/i]) { ok(); } } ng(); return 0; }