a, b = map(int, input().split()) t = set() a %= b while True: a *= 10 a %= b if a == 0: print('Yes') exit() if a in t: print('No') exit() t.add(a)