S = input().strip() target = int(S) found = False for r in range(10**6): if (r * r) % (10**6) == target: found = True break print("YES" if found else "NO")