#include using namespace std; using ll = long long; using P = pair; using PP = pair; #define fix(x) fixed << setprecision(x) #define asc(x) x, vector, greater #define rep(i, n) for(ll i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() templatebool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;} templatebool chmax(T&a, const T&b){if(a> h >> w >> y >> x; x--; y--; vector> a(h,vector(w)); rep(i,h)rep(j,w) cin >> a[i][j]; ll now = a[y][x]; a[y][x] = -1; priority_queue pq; rep(i,4){ int nh = y+H[i], nw = x+W[i]; if(nh<0 || nh>=h || nw<0 || nw>=w) continue; pq.push({a[nh][nw], {nh, nw}}); a[nh][nw] = -1; } while(pq.size()){ ll s = pq.top().first; tie(y,x) = pq.top().second; pq.pop(); if(s>=now){ cout << "No\n"; return 0; } now += s; rep(i,4){ int nh = y+H[i], nw = x+W[i]; if(nh<0 || nh>=h || nw<0 || nw>=w || a[nh][nw]<0) continue; pq.push({a[nh][nw], {nh, nw}}); a[nh][nw] = -1; } } cout << "Yes\n"; return 0; }