S = int(input())
M = 10 ** 7
for i in range(M):
    if i * i % M == S:
        print("YES")
        exit()
print("NO")