s = input() for i in range(10**3,10**6): if str(i*i)[-6:] == s: print("YES"); break else: print("NO")