S = gets.to_i if 0.upto(999999).any? { |n| S == (n * n) % 1_000_000 } puts "YES" else puts "NO" end