#include #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; template struct edge{ int to; T wt; edge(int to,const T& wt):to(to),wt(wt){} }; template using weighted_graph=vector>>; template vector Dijkstra(const weighted_graph& G,int s){ const T INF=numeric_limits::max(); int n=G.size(); vector d(n,INF); d[s]=0; priority_queue> Q; Q.emplace(0,s); while(!Q.empty()){ T d0=-Q.top().first; int u=Q.top().second; Q.pop(); if(d0>d[u]) continue; for(const auto& e:G[u]){ int v=e.to; if(d[v]>d[u]+e.wt) d[v]=d[u]+e.wt, Q.emplace(-d[v],v); } } return d; } int main(){ int n,hp,ox,oy,a[200][200]; scanf("%d%d%d%d",&n,&hp,&ox,&oy); ox--; oy--; rep(i,n) rep(j,n) scanf("%d",&a[i][j]); weighted_graph G(n*n); rep(i,n) rep(j,n) { if(id[n*n-1]) return puts("YES"),0; if(ox==-1) return puts("NO"),0; auto d2=Dijkstra(G,oy*n+ox); puts(hp>d[oy*n+ox]&&2*(hp-d[oy*n+ox])>d2[n*n-1]?"YES":"NO"); return 0; }