x,y=map(int, input().split()) import math d=math.gcd(x,y) x//=d y//=d a=10 for i in range(20): if a%y==0: print('No') exit() else: a*=10 print('Yes')