a, b = gets.split a = a.slice( 0, a.index( ?. ) ) + a.slice( a.index( ?. ) + 1 .. -1 ) b = b.slice( 0, b.index( ?. ) ) + b.slice( b.index( ?. ) + 1 .. -1 ) a = Rational( a, 10000 ) b = Rational( b, 10000 ) res = Rational( a ** b ) if res.denominator == 1 then puts "Yes" else puts "No" end