#include using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define chmax(x,y) x = max(x,y) using ll = long long; using P = pair; int main(){ ll a,b; cin>>a>>b; ll g = __gcd(a,b); a /= g; b /= g; bool ok = true; while(1){ if(b%2==0){ b /= 2; }else{ break; } } while(1){ if(b%5==0){ b /= 5; }else{ break; } } if(b>1){ cout << "Yes" << endl; }else{ cout << "No" << endl; } }