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