S=int(input()) for i in range(1000000): if i*i%1000000==S: print('YES') exit() print('NO')