import math a,b = map(int,input().split()) G = math.gcd(a,b) a = a//G b = b//G if b == 1: print("No");exit() two = [1] for i in range(60): two.append(two[-1]*2) five = [1] for i in range(30): five.append(five[-1]*5) S = set([]) for t in two: for f in five: S.add(t*f) if b in S: print("No") else: print("Yes")