#include #include #include #include #define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define li long long int #define rep(i,to) for(li i=0;i<((li)(to));i++) #define repp(i,start,to) for(li i=(li)(start);i<((li)(to));i++) #define pb push_back #define sz(v) ((li)(v).size()) #define bgn(v) ((v).begin()) #define eend(v) ((v).end()) #define allof(v) (v).begin(), (v).end() #define dodp(v,n) memset(v,(li)n,sizeof(v)) #define bit(n) (1ll<<(li)(n)) #define mp(a,b) make_pair(a,b) #define rin rep(i,n) #define EPS 1e-10 #define ETOL 1e-8 #define MOD 100000000 #define F first #define S second #define p2(a,b) cout< PI; li n, v, ox, oy; li w[222][222]; li vis[222][222]; li dx[4]={-1, 1, 0, 0}; li dy[4]={0, 0, -1, 1}; li dijkstra(PI from, PI to){ rep(i,n)rep(j,n)vis[i][j]=NVAL; priority_queue > > q; q.push(mp(0, from)); while(!q.empty()){ li cost=-q.top().F; PI now=q.top().S; //p3(cost, now.F, now.S); if(now==to)return cost; q.pop(); if(vis[now.S][now.F]!=NVAL)continue; vis[now.S][now.F]=min(vis[now.S][now.F], cost); rep(i,4){ li nx=now.F+dx[i], ny=now.S+dy[i]; if(min(nx, ny)>=0 && nxcost+w[ny][nx]){ q.push(mp(-(cost+w[ny][nx]), mp(nx, ny))); } } } return vis[to.S][to.F]; } int main(){ cin>>n>>v>>ox>>oy; rin{rep(j,n)cin>>w[i][j];} if(dijkstra(mp(0,0), mp(n-1, n-1))0 && (v-w1)*2-dijkstra(mp(ox-1, oy-1), mp(n-1, n-1))>0)puts("YES"); else puts("NO"); } //cout<0)cout<0)cout<