#include int main(void) { int h, w, n, k; int no = 0; scanf("%d%d%d%d", &h, &w, &n, &k); int **math = new int*[h]; for (int i = 0; i < h; i++) { math[i] = new int[w]; } for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { no++; math[i][j] = no; if (no == n) { no = 1; } } } if (math[h - 1][w - 1] == k) { printf("YES\n"); } else { printf("NO\n"); } return 0; }