require 'prime' A, B = gets.split.map(&:to_i).sort if A % B != 0 puts 'No' exit end a = A b = B c = 0 while b >= a && b % a == 0 b /= a c += 1 end if b == 1 && A * c == B puts 'Yes' else puts 'No' end