def divcount(n,x): res = 0 while n>0: if n%x == 0: n //= x res += 1 else: break return res a,b = map(int,input().split()) if a%b == 0: print("No") exit(0) a2 = divcount(a,2) a5 = divcount(a,5) b2 = divcount(b,2) b5 = divcount(b,5) a2 = max(a2-b2,0) b2 = max(b2-a2,0) a5 = max(a5-b5,0) b5 = max(b5-a5,0) a //= 2**a2 a //= 5**a5 b //= 2**b2 b //= 5**b5 b2 = divcount(b,2) b5 = divcount(b,5) b //= 2**b2 b //= 5**b5 if b != 1: print("Yes") else: print("No")