import math a,b=map(int,input().split()) g=math.gcd(a,b) b=b//g while b%2==0:b=b//2 while b%5==0:b=b//5 print("Yes" if b!=1 else "No")