from heapq import heappush, heappop import sys input = sys.stdin.readline def dijkstra(si, sj): dist = [[V] * N for _ in range(N)] dist[si][sj] = 0 pq = [(0, si, sj)] while pq: d, i, j = heappop(pq) if dist[i][j] < d: continue for di, dj in [(1, 0), (0, 1), (-1, 0), (0, -1)]: ni, nj = i + di, j + dj if 0 <= ni < N and 0 <= nj < N and dist[ni][nj] > d + L[ni][nj]: dist[ni][nj] = d + L[ni][nj] heappush(pq, (d + L[ni][nj], ni, nj)) return dist N, V, Ox, Oy = map(int, input().split()) Ox -= 1 Oy -= 1 L = [list(map(int, input().split())) for _ in range(N)] dist0 = dijkstra(0, 0) if Ox == Oy == -1: print('YES' if dist0[N-1][N-1] < V else 'NO') exit() dist1 = dijkstra(Ox, Oy) print('YES' if dist0[N-1][N-1] < V or (V - dist0[Ox][Oy]) * 2 > dist1[N-1][N-1] else 'NO')