n, z = gets.split.map &:to_i r = (1..z).to_a puts r.product(r).find { _1**n + _2**n == z**n } ? "Yes" : "No"