#include using namespace std; #ifdef _RUTHEN #include "debug.hpp" #else #define show(...) true #endif using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) template using V = vector; int main() { ios::sync_with_stdio(false); cin.tie(0); int H, W, X, Y; cin >> H >> W >> X >> Y; X--, Y--; V> A(H, V(W)); rep(i, H) rep(j, W) cin >> A[i][j]; priority_queue> que; V> vis(H, V(W, 0)); ll s = A[X][Y]; const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; rep(k, 4) { int nx = X + dx[k], ny = Y + dy[k]; if (0 <= nx && nx < H && 0 <= ny && ny < W) { que.push({-A[nx][ny], nx, ny}); vis[nx][ny] = 1; } } vis[X][Y] = 1; int cnt = 1; while (!que.empty()) { auto [a, i, j] = que.top(); que.pop(); a = -a; if (s > a) { s += a; cnt++; rep(k, 4) { int nx = i + dx[k], ny = j + dy[k]; if (0 <= nx && nx < H && 0 <= ny && ny < W && vis[nx][ny] == 0) { que.push({-A[nx][ny], nx, ny}); vis[nx][ny] = 1; } } } else { break; } } show(cnt, s); cout << (cnt == H * W ? "Yes" : "No") << '\n'; return 0; }