require 'prime' a, b = gets.split.map &:to_i g = a.gcd b a /= g b /= g puts b.prime_division.any? { |x, y| x != 2 && x != 5 } ? 'Yes' : 'No'