#include #include #include using namespace std; const int inf=100000; int cost[210][210], a[210][210]; int dr[]={-1, 0, 1, 0}, dc[]={0, -1, 0, 1}; int main() { int n, v, ox, oy; while (cin>>n>>v>>ox>>oy) { ox--, oy--; for(int i=0;i>a[i][j]; cost[i][j]=100000; } cost[0][0]=a[0][0]; priority_queue> q; q.emplace(-cost[0][0], 0, 0); while (q.size()) { int d, r, c; tie(d, r, c)=q.top(); q.pop(); d=-d; if (d>cost[r][c]) continue; for(int i=0;i<4;++i) { int nr=r+dr[i], nc=c+dc[i]; if (nr<0 or nr>=n or nc<0 or nc>=n) continue; if (cost[nr][nc]>d+a[nr][nc]) { cost[nr][nc]=d+a[nr][nc]; q.emplace(-d-a[nr][nc], nr, nc); } } } if (cost[n-1][n-1]=0 and ox>=0 and 2*(v-cost[oy][ox])>cost[n-1][n-1]-cost[oy][ox])) cout<<"YES"<