#include int h, w, y, x; long long int a[502][502]; int heap[2000006], hl; int comp_h(int i, int j) { if (a[heap[i] / w][heap[i] % w] > a[heap[j] / w][heap[j] % w]) return 1; else return -1; } void swap_h(int i, int j) { int f = heap[i]; heap[i] = heap[j]; heap[j] = f; return; } void push(int ne) { heap[hl] = ne; int p = hl; hl++; for (; p > 0; p = (p - 1) / 2) if (comp_h((p - 1) / 2, p) > 0) swap_h((p - 1) / 2, p); return; } int pop() { hl--; swap_h(0, hl); int p = 0; for (;;) { if (2 * p + 2 < hl) { if (comp_h(2 * p + 1, 2 * p + 2) > 0) { if (comp_h(p, 2 * p + 2) > 0) swap_h(p, 2 * p + 2); p = 2 * p + 2; } else { if (comp_h(p, 2 * p + 1) > 0) swap_h(p, 2 * p + 1); p = 2 * p + 1; } } else if (2 * p + 1 < hl) { if (comp_h(p, 2 * p + 1) > 0) swap_h(p, 2 * p + 1); p = 2 * p + 1; } else break; } return heap[hl]; } int used[502][502]; int main() { scanf("%d %d %d %d", &h, &w, &y, &x); int i, j, k; for (i = 0; i < h; i++) for (j = 0; j < w; j++) scanf("%lld", &a[i][j]); int di[4] = { -1,0,1,0 }; int dj[4] = { 0,-1,0,1 }; for (i = 0; i < h; i++) for (j = 0; j < w; j++) used[i][j] = 0; int ii, jj; long long int v = a[y - 1][x - 1]; a[y - 1][x - 1] = 0; hl = 0; push(w * (y - 1) + x - 1); while (hl > 0) { i = pop(); j = i % w; i /= w; if (used[i][j] > 0) continue; if (a[i][j] >= v) { printf("No\n"); return 0; } v += a[i][j]; used[i][j]++; for (k = 0; k < 4; k++) { ii = i + di[k]; jj = j + dj[k]; if (ii < 0 || jj < 0 || i == h || j == w) continue; if (used[ii][jj] > 0) continue; push(w * ii + jj); } } printf("Yes\n"); return 0; }