#include #include void check(int *a, int *b); int main(void){ int h, w, n, k, count = 1; scanf("%d %d %d %d", &h, &w, &n, &k); if (h > w) { h = h - w; w = 1; } else if(h < w) { w = w - h; h = 1; } else{ h = 1; w = 1; } n = n - k; k = 1; for(;;){ if(w == 1 && h == 1){ if(count == k) printf("YES\n"); else printf("NO\n"); break; } if(h > w) check(&h, &w); else check(&w, &h); count++; if(count == n + 1) count = 1; } return 0; } void check(int *a, int *b){ if(*a == 0){ if(*b != 0) (*b)--; } else (*a)--; }