from math import gcd A,B=map(int,input().split()) B//=gcd(A,B) while B%2==0: B//=2 while B%5==0: B//=5 print('YNeos'[B==1::2])