from collections import deque from collections.abc import Iterator def neighbors4(r: int, c: int) -> Iterator[tuple[int, int]]: for dr, dc in [(-1, 0), (1, 0), (0, -1), (0, 1)]: nr = r + dr nc = c + dc if not (0 <= nr < N and 0 <= nc < N): continue yield nr, nc INF = 1 << 60 N, V, OX, OY = map(int, input().split()) G = [] for _ in range(N): G.append(list(map(int, input().split()))) def bfs(sr: int, sc: int, v: int): t = [[-INF] * N for _ in range(N)] q = deque([(sr, sc)]) t[sr][sc] = v while q: r, c = q.popleft() for nr, nc in neighbors4(r, c): nv = t[r][c] - G[nr][nc] if nv < 0 or t[nr][nc] >= nv: continue t[nr][nc] = nv q.append((nr, nc)) return t # オアシスを経由せずに到達できるか t = bfs(0, 0, V) if t[N-1][N-1] > 0: print('YES') exit() if (OX, OY) != (0, 0) and t[OY-1][OX-1] > 0: v = t[OY-1][OX-1] * 2 t = bfs(OY-1, OX-1, v) if t[N-1][N-1] > 0: print('YES') exit() print('NO')