#include using namespace std; int h, w, x, y; long long z; long long a[500][500]; bool f[500][500]; typedef pair> P; priority_queue, greater

> Q; int main() { cin >> h >> w >> x >> y; x--; y--; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { cin >> a[i][j]; } } Q.push(make_pair(0, make_pair(x, y))); f[x][y] = 1; z = a[x][y]; while (!Q.empty()) { long long c = Q.top().first; if (z <= c) break; else z += c; int d = Q.top().second.first, e = Q.top().second.second; Q.pop(); if (d > 0 && !f[d - 1][e]) { f[d - 1][e] = 1; Q.push(make_pair(a[d - 1][e], make_pair(d - 1, e))); } if (d < h - 1 && !f[d + 1][e]) { f[d + 1][e] = 1; Q.push(make_pair(a[d + 1][e], make_pair(d + 1, e))); } if (e > 0 && !f[d][e - 1]) { f[d][e - 1] = 1; Q.push(make_pair(a[d][e - 1], make_pair(d, e - 1))); } if (e < w - 1 && !f[d][e + 1]) { f[d][e + 1] = 1; Q.push(make_pair(a[d][e + 1], make_pair(d, e + 1))); } } if (Q.empty()) cout << "Yes" << endl; else cout << "No" << endl; }