n = int(input()) for i in range(10**6): if i**2%(10**6) == n: print("YES") exit() print("NO")