#include <bits/stdc++.h>
using namespace std;

int main(){
    int64_t A, B;
    cin >> A >> B;
    B /= gcd(A, B);
    while(B%2 == 0) B /= 2;
    while(B%5 == 0) B /= 5;
    cout << (B > 1 ? "Yes" : "No") << endl;
    return 0;
}