#include #define ll long long #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #pragma warning(disable: 4996) int main(void) { ll p; scanf("%lld", &p); ll K = (p - 1) >> 1; ll a = p - (((K * K) << 2) + (K << 4) - 1) % p; ll r = 1; for (K; K > 0; K >>= 1) { if (K & 1) { r = r * a % p; } a = a * a % p; } if (r == 1) { puts("YES"); } else { puts("NO"); } return 0; }