p = int(input()) k = (p-1) // 2 targ = (1 - 4*k*k - 16*k) % p if targ == 0: print("YES") else: if pow(targ, k, p) == 1: print("YES") else: print("NO")