#include #define REP(i,s,n) for(int i=s;i> h >> w >> n >> k; ll loser = h * w; loser %= n; loser = ( loser - 1 + n ) % n; --k; puts((loser==k)?"YES":"NO"); return 0; }