import std.algorithm, std.array, std.container, std.range; import std.string, std.conv, std.math; import std.stdio, std.typecons; void main() { auto n = readln.chomp.to!long; auto max = sqrt(n.to!real).to!int; auto pi = primes(max); auto r = pi.any!(p => n % p == 0 && !isPrime(n / p, pi)); writeln(r ? "YES" : "NO"); } bool isPrime(long n, int[] pi) { return pi .until!(p => p > sqrt(n.to!real).to!int) .all!(p => n % p != 0); } int[] primes(int n) { auto sieve = new bool[n + 1]; sieve.fill(true); auto max = sqrt(n.to!real).to!int; for (auto p = 2; p <= max; ++p) if (sieve[p]) for (auto q = p * 2; q <= n; q += p) sieve[q] = false; int[] r; for (auto p = 2; p <= n; ++p) if (sieve[p]) r ~= p; return r; }