#include using namespace std; int rm[200][200][2]; int dy[] = {0, 1, 0, -1}; int dx[] = {1, 0, -1, 0}; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, v, ox, oy; cin >> n >> v >> ox >> oy; --ox, --oy; vector > bd(n, vector(n)); for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) cin >> bd[i][j]; queue > q; q.emplace(0, 0, 1, v); rm[0][0][1] = v; while (!q.empty()) { int y, x, has, vital; tie(y, x, has, vital) = q.front(); q.pop(); if (rm[y][x][has] > vital) continue; for (int k = 0; k < 4; k++) { int y2 = y + dy[k]; int x2 = x + dx[k]; if (x2 < 0 || x2 >= n) continue; if (y2 < 0 || y2 >= n) continue; if (vital <= bd[y2][x2]) continue; int vital2 = vital - bd[y2][x2]; int has2 = has; if (has2 && y2 == oy && x2 == ox) { vital2 *= 2; has2 = 0; } if (vital2 > rm[y2][x2][has2]) { q.emplace(y2, x2, has2, vital2); rm[y2][x2][has2] = vital2; } } } if (rm[n-1][n-1][0] || rm[n-1][n-1][1]) cout << "YES" << endl; else cout << "NO" << endl; return 0; }