def factorization(n): arr = [] temp = n if temp%2 == 0: cnt = 0 while temp%2 == 0: cnt += 1 temp//=2 arr.append(2) for i in range(3, int(-(-n**0.5//1))+1,2): if temp%i==0: cnt=0 while temp%i==0: cnt+=1 temp //= i arr.append(i) if temp!=1: arr.append(temp) return arr 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() A = factorization(b) for x in A: if x == 2 or x == 5: print("No");exit() print("Yes")