def gcd(a, b) a, b = b, a if a > b while a > 0 b %= a a, b = b, a end b end a, b = gets.split.map &:to_i b /= gcd(a, b) b /= 2 while b % 2 == 0 b /= 5 while b % 5 == 0 puts ((b > 1) ? "Yes" : "No")