N = int(input()) x = 10 ** 6 for i in range(x): if (i * i) % x == N: print("YES") break else: print("NO")