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