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