a, b = map(int, input().split()) for i in range(10**5): a = a % b if a == 0: print("No") break a *= 10 else: print("Yes")