#include #include #include #include using namespace std; using i64 = long long; using u64 = unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) vector> factorize(u64 n){ vector> res; for(u64 i=2; i*i<=n; i++){ if(n%i) continue; res.push_back({i,0}); while(n%i==0){ n/=i; res.back().second++; } } if(n!=1) res.push_back({n,1}); return move(res); } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); u64 x, x_idx, y, y_idx; cin >> x >> x_idx >> y >> y_idx; auto x_fact_vec = factorize(x); for(auto& f : x_fact_vec) f.second *= x_idx; auto y_fact_vec = factorize(y); for(auto& f : y_fact_vec) f.second *= y_idx; auto x_fact_map = map(x_fact_vec.begin(), x_fact_vec.end()); bool ans = true; for(auto y_prime_factor : y_fact_vec){ if(x_fact_map[y_prime_factor.first] < y_prime_factor.second) ans = false; } cout << (ans ? "Yes\n" : "No\n"); return 0; }