a,b = list(map(int,input().split())) def gcd(x,y): while True: r = x % y x = y y = r if r == 0: return x b = b // gcd(a,b) while b % 2 == 0: b = b // 2 while b % 5 == 0: b = b // 5 if b == 1: print('No') else: print('Yes')