#include #include using namespace std; int main() { long long x, y, a, b; cin >> x >> a >> y >> b; if (y == 1) { cout << "Yes" << endl; return 0; } if (x == y && a >= b) { cout << "Yes" << endl; return 0; } long long x_ = x; long long y_ = y; vector cnt_x(1000000, 0), cnt_y(1000000, 0); for (long long i = 2; i < 1000000; i++) { while (x % i == 0) { x /= i; cnt_x[i]++; } } for (long long i = 2; i < 1000000; i++) { while (y % i == 0) { y /= i; cnt_y[i]++; } } if (x % y != 0) { cout << "No" << endl; return 0; } for (int i = 2; i < 1000000; i++) { if (cnt_x[i] * a < cnt_y[i] * b) { cout << "No" << endl; //cout << i << endl; return 0; } } if (y != 1 && a < b) { cout << "No" << endl; return 0; } cout << "Yes" << endl; }