a,b = map(int,input().split()) x = [a] i = 0 while True: a = a%b a = 10*a if a in x and a != 0: print("Yes") exit() else: if i == b - 1 or a ==0: print("No") exit() else: i += 1 x.append(a)