n, z = gets.split.map(&:to_i) if n >= 3 puts :No else dpn = Array.new(z + 1){|i| i ** n } ans = (1 ... z).find{|x| dpn[z] - dpn[x] == dpn.bsearch{|v| v >= dpn[z] - dpn[x] } } puts ans ? :Yes : :No end