#include #include #include #include using namespace std; using i32 = int32_t; using u32 = uint32_t; using i64 = int64_t; using u64 = uint64_t; #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(){ 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; } struct ios_do_not_sync { ios_do_not_sync() { ios::sync_with_stdio(false); cin.tie(nullptr); } } ios_do_not_sync_instance;