#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int N,V,ox,oy; cin >> N >> V >> ox >> oy; ox--; oy--; vector> L(N,vector(N)); for(auto &h : L) for(auto &w : h) cin >> w; swap(ox,oy); vector dist(N,vector(N,vector(2,0))); dist.at(0).at(0).at(0) = V; priority_queue> Q; Q.push({V,0,0,0}); vector> dxy = {{-1,0},{0,1},{1,0},{0,-1}}; while(Q.size()){ auto [v,x,y,z] = Q.top(); Q.pop(); if(dist.at(x).at(y).at(z) != v) continue; if(x == ox && y == oy && z == 0) z = 1,v *= 2,dist.at(x).at(y).at(z) = v; for(auto [dx,dy] : dxy){ int nx = x+dx,ny = y+dy; if(min(nx,ny) < 0 || max(nx,ny) >= N) continue; int nv = v-L.at(nx).at(ny); if(dist.at(nx).at(ny).at(z) < nv) dist.at(nx).at(ny).at(z) = nv,Q.push({nv,nx,ny,z}); } } if(dist.at(N-1).at(N-1).at(0) > 0 || dist.at(N-1).at(N-1).at(1) > 0) cout << "YES\n"; else cout << "NO\n"; }