n, v, ox, oy = map(int, input().split()) ox -= 1 oy -= 1 l = [list(map(int, input().split())) for _ in range(n)] INF = 10 ** 18 from heapq import heappush, heappop dx = [1,0,-1,0] dy = [0,1,0,-1] def min_cost(sx, sy, gx, gy): dp = [[INF] * n for _ in range(n)] dp[sx][sy] = 0 q = [(0, sx, sy)] while q: cost, x, y = q.pop() if cost > dp[x][y]: continue for k in range(4): nx = x + dx[k] ny = y + dy[k] if not (0 <= nx < n and 0 <= ny < n): continue nc = cost + l[nx][ny] if nc < dp[nx][ny]: dp[nx][ny] = nc heappush(q, (nc, nx, ny)) return dp[gx][gy] ok = False if min_cost(0, 0, n-1, n-1) < v: ok = True if ox >= 0: nv = v - min_cost(0, 0, ox, oy) if nv >= 1: nv *= 2 if min_cost(ox, oy, n-1, n-1) < nv: ok = True print('YES' if ok else 'NO')