char comment[] = "Yukicoder No Three zero two three. by Bal for u"; #include #include 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() { int N; false = zero, true = one = !zero; two = one << one, three = two | one; scanf("%d", &N); puts(check(N)? "YES": "NO"); return zero; }