from itertools import count def gcd(*numbers: int) -> int: if len(numbers) == 1: return numbers[0] if len(numbers) == 2: a, b = numbers if a < b: a, b = b, a while True: if a % b == 0: return b a, b = b, a % b first_gcd = gcd(*numbers[:2]) return gcd(first_gcd, *numbers[2:]) def calc_prime_factorize(num: int) -> dict[int, int]: if num < 2: raise ValueError divisors = {} for divisor in count(2): if divisor ** 2 > num: if num != 1: divisors[num] = 1 break while num % divisor == 0 and num != 1: try: divisors[divisor] += 1 except KeyError: divisors[divisor] = 1 num //= divisor return divisors def main(): a, b = map(int, input().split()) ab_gcd = gcd(a, b) a //= ab_gcd b //= ab_gcd if b == 1: print("No") return while not b % 2: b //= 2 while not b % 5: b //= 5 if b == 1: print("No") else: print("Yes") if __name__ == "__main__": main()