require 'prime' puts Rational(*(gets.split.map(&:to_i))).denominator.prime_division.map(&:first).reject{|e| [2,5].include?(e)}.empty? ? 'No' : 'Yes'