#include using namespace std; using ll = long long; template using pq = priority_queue, greater>; int main(){ int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; ll H, W, Y, X, cnt=1, now, h, w, nh, nw, e; cin >> H >> W >> Y >> X; vector> A(H+1, vector(W+1)); pq> que; for (int i=1; i<=H; i++){ for (int j=1; j<=W; j++) cin >> A[i][j]; } now = A[Y][X]; A[Y][X] = 0; h = Y; w = X; for (int i=0; i<4; i++){ nh = h+dx[i]; nw = w+dy[i]; if (nh == 0 || nw == 0 || nh == H+1 || nw == W+1) continue; que.push({A[nh][nw], nh, nw}); A[nh][nw] = 0; } while(!que.empty()){ tie(e, h, w) = que.top(); que.pop(); if (e >= now){ cout << "No" << endl; return 0; } now += e; cnt++; for (int i=0; i<4; i++){ nh = h+dx[i]; nw = w+dy[i]; if (nh == 0 || nw == 0 || nh == H+1 || nw == W+1) continue; if (A[nh][nw] == 0) continue; que.push({A[nh][nw], nh, nw}); A[nh][nw] = 0; } } cout << (cnt == H*W ? "Yes" : "No") << endl; return 0; }