#include #include #include #include #include #include #include #include #include #include #include #include #define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x << "=" << x << endl; #define debug(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << x << endl; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } using namespace std; typedef long long ll; using P = pair; vector

factorize(ll x){ ll y = x; vector

ans; for(ll n = 2; n*n <= x; n++){ if(y%n == 0){ ll cnt = 0; while(y%n == 0) { cnt++; y /= n; } ans.push_back(P(n, cnt)); } } if(y != 1) ans.push_back(P(y, 1)); return ans; } int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; ll x, a, y, b; cin >> x >> a >> y >> b; auto fx = factorize(x); auto fy = factorize(y); map mp; for(auto [m, c]: fx) { mp[m] = c*b; } for(auto [m, c]: fy){ if(mp.count(m) == 0){ cout << "No" << endl; return 0; } if(c*a > mp[m]){ cout << "No" << endl; return 0; } } cout << "Yes" << endl; }