import heapq import sys input = sys.stdin.buffer.readline sys.setrecursionlimit(10 ** 7) inf = 10000 DX = (-1, 0, 1, 0, -1, -1, 1, 1) DY = (0, 1, 0, -1, -1, 1, -1, 1) DX = DX[:4] DY = DY[:4] N, V, oy, ox = map(int, input().split()) L = tuple(tuple(map(int, input().split())) for _ in range(N)) ox -= 1 oy -= 1 dist = [[inf] * N for _ in range(N)] dist[0][0] = 0 que = [(0, 0, 0)] while que: ds, x, y = heapq.heappop(que) if dist[x][y] < ds: continue for dx, dy in zip(DX, DY): nx = x + dx ny = y + dy if nx < 0 or N <= nx or ny < 0 or N <= ny: continue cost = ds + L[nx][ny] if cost >= V: continue if dist[nx][ny] > cost: dist[nx][ny] = cost if (nx, ny) == (ox, oy): dist[nx][ny] -= (V - cost) ox = -1 oy = -1 heapq.heappush(que, (dist[nx][ny], nx, ny)) # if 1: # import numpy as np # print(np.array(dist)) if dist[N - 1][N - 1] < V: print("YES") else: print("NO")