/* -*- coding: utf-8 -*- * * 2379.cc: No.2379 Burnside's Theorem - yukicoder */ #include #include #include #include using namespace std; /* constant */ const int MAX_P = 1000100; /* typedef */ typedef long long ll; typedef vector vi; typedef pair pli; typedef vector vpli; /* global variables */ bool primes[MAX_P + 1]; /* subroutines */ int gen_primes(int maxp, vi &pnums) { fill(primes, primes + maxp + 1, true); primes[0] = primes[1] = false; int p; for (p = 2; p * p <= maxp; p++) if (primes[p]) { pnums.push_back(p); for (int q = p * p; q <= maxp; q += p) primes[q] = false; } for (; p <= maxp; p++) if (primes[p]) pnums.push_back(p); return (int)pnums.size(); } bool prime_decomp(ll n, vi &pnums, vpli& pds) { pds.clear(); int pn = pnums.size(); for (int i = 0; i < pn; i++) { int pi = pnums[i]; if ((ll)pi * pi > n) { if (n > 1) pds.push_back(pli(n, 1)); return true; } if (n % pi == 0) { int fi = 0; while (n % pi == 0) n /= pi, fi++; pds.push_back(pli(pi, fi)); } } return false; } /* global variables */ /* subroutines */ /* main */ int main() { vi pnums; gen_primes(MAX_P, pnums); ll n; scanf("%lld", &n); vpli pds; prime_decomp(n, pnums, pds); if (pds.size() <= 2) puts("Yes"); else puts("No"); return 0; }