import math a, b = map(int, input().split()) c = math.gcd(a, b) b //= c while b % 5 == 0: b //= 5 while b % 2 == 0: b //= 2 print(['No', 'Yes'][b != 1])