#include #include int N; int zero, one, two, three; int true, false; int add(int a, int b) { int c; while (b != zero) c = (a & b) << one, a ^= b, b = c; return a; } int check(int n) { int a, b; if (N == one) return false; if (N == two) return true; if (N % two == zero) return false; b = (int)sqrt((double)N); a = three; while (a <= b) { if (N % a == zero) return false; a = add(a, two); } return true; } int main() { false = zero, true = one = !zero; two = one << one, three = two | one; scanf("%d", &N); puts(check(N)? "YES": "NO"); return zero; }