import sys input = sys.stdin.readline p = int(input()) K = (p - 1) >> 1 a = p - abs(-4 * K * K - 16 * K + 1) % p if(pow(a, K, p) == 1): print("YES") else: print("NO")