a = int(input()) b = int(input()) b /= gcd(a, b) c = 10**12345678910 print("Yes" if c % b == 0 else "No")