from heapq import *

n, v, oy, ox = map(int, input().split())
L = [list(map(int, input().split())) for _ in range(n)]
inf = 1 << 30
directions = [(-1, 0), (1, 0), (0, -1), (0, 1)]


def dijkstra(si, sj):
    dist = [[inf] * n for _ in range(n)]
    dist[si][sj] = 0
    hq = [(0, si, sj)]
    while hq:
        d, i, j = heappop(hq)
        if dist[i][j] < d:
            continue
        for di, dj in directions:
            ni = i + di
            nj = j + dj
            if ni == -1 or nj == -1 or ni == n or nj == n:
                continue
            tmp = d + L[ni][nj]
            if tmp < dist[ni][nj]:
                dist[ni][nj] = tmp
                heappush(hq, (tmp, ni, nj))
    return dist

dist = dijkstra(0, 0)
if dist[-1][-1] < v:
    print("YES")
    exit()
if ox == oy == 0:
    print("NO")
    exit()
ox -= 1
oy -= 1
v -= dist[ox][oy]

if v <= 0:
    print("NO")
    exit()
v *= 2
dist = dijkstra(ox, oy)
if dist[-1][-1] < v:
    print("YES")
else:
    print("NO")