#include "bits/stdc++.h" using namespace std; typedef long long Int; #define REP(i,n) for(int (i)=0;(i)<(int)(n);++(i)) int N; int OX, OY; int L[200][200]; int memo[200][200][2]; bool isin(int x, int y) { return 0 <= x && x < N && 0 <= y && y < N; } struct S { int x, y, v, o; int& ref() { return memo[x][y][o]; } bool operator<(const S& o) const { return v < o.v; } }; const int dx[] = { 0, 1, 0, -1 }; const int dy[] = { 1, 0, -1, 0 }; int main() { int V; cin >> N >> V; cin >> OY >> OX; OX--; OY--; REP(i, N) REP(j, N) cin >> L[i][j]; bool ok = false; queue pq; S start; start.x = 0; start.y = 0; start.v = V; start.o = 0; start.ref() = V; pq.push(start); while (!pq.empty()) { S cur = pq.front(); pq.pop(); if (cur.v <= 0) continue; if (cur.x == N-1 && cur.y == N-1) { ok = true; break; } if (cur.ref() != cur.v) continue; REP(i, 4) { int nx = cur.x + dx[i]; int ny = cur.y + dy[i]; if (isin(nx, ny)) { S next = cur; next.x = nx; next.y = ny; next.v -= L[nx][ny]; if (nx == OX && ny == OY && next.o == 0) { next.v *= 2; next.o = 1; } if (next.ref() < next.v) { next.ref() = next.v; pq.push(next); } } } } cout << (ok ? "YES" : "NO") << endl; }