#include using namespace std; int main() { // your code goes here long long x,a,y,b; cin>>x>>a>>y>>b; long long i = pow(x,a); long long j = pow(y,b); long long mx = 0,mn = 0; if(i>j){ mx = i; mn = j; } else{ mx = j; mn = i; } if((i==j)||(mx%mn==0)){ cout<<"YES"<