import heapq INF = 1 << 60 n, v, ox, oy = map(int, input().split()) ox -= 1 oy -= 1 l = [list(map(int, input().split())) for _ in range(n)] dx = [1, 0, -1, 0] dy = [0, 1, 0, -1] def cost(sx, sy, gx, gy): dist = [[INF for _ in range(n)] for _ in range(n)] dist[sx][sy] = 0 hp = [(0, sx, sy)] while len(hp) > 0: cd, cx, cy = heapq.heappop(hp) if cd > dist[cx][cy]: continue for i in range(4): nx = cx + dx[i] ny = cy + dy[i] if nx < 0 or nx >= n or ny < 0 or ny >= n: continue if dist[nx][ny] > dist[cx][cy] + l[nx][ny]: dist[nx][ny] = dist[cx][cy] + l[nx][ny] heapq.heappush(hp, (dist[nx][ny], nx, ny)) return dist[gx][gy] if ox == -1 and oy == -1: rest = v - cost(0, 0, n - 1, n - 1) if rest <= 0: print("NO") else: print("YES") else: rest = v - cost(0, 0, ox, oy) if rest <= 0: print("NO") else: rest = 2 * rest - cost(ox, oy, n - 1, n - 1) if rest <= 0: print("NO") else: print("YES")