from heapq import heappush, heappop
inf = float('inf')


def dijkstra(s, g, N):
    # ゴールがない場合はg=-1とする。

    def cost(v, m):
        return v * N + m

    dist = [inf] * N
    mindist = [inf] * N
    seen = [False] * N
    Q = [cost(0, s)]
    while Q:
        c, m = divmod(heappop(Q), N)
        if seen[m]:
            continue
        seen[m] = True
        dist[m] = c
        if m == g:
            return dist

        #------heapをアップデートする。--------
        for u, C in G[m]:
            if seen[u]:
                continue
            newdist = dist[m] + C

            #------------------------------------
            if newdist >= mindist[u]:
                continue
            mindist[u] = newdist
            heappush(Q, cost(newdist, u))
            
    return dist


N, V, qx, qy = map(int, input().split())
L = []
for i in range(N):
    L.append(list(map(int, input().split())))
    
G = [[] for i in range(N * N)]
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]
for i in range(N):
    for j in range(N):
        for k in range(4):
            x = i + dx[k]
            y = j + dy[k]
            if x < 0 or x > N - 1 or y < 0 or y > N - 1:
                continue
            G[i * N + j].append((x * N + y, L[x][y]))
            
D = dijkstra(0, -1, N * N)
if D[-1] < V:
    print("YES")
    exit()

if qx == 0 and qy == 0:
    print("NO")
    exit()
    
qy, qx = qx - 1, qy - 1    
V -= D[qx * N + qy]
V *= 2
D2 = dijkstra(qx * N + qy, -1, N * N)
print("YES") if D2[-1] < V else print("NO")