import java.util.Scanner; public class Yukicoder20 { int N, V, Ox, Oy; int[][] L; int[][][] dp; int[] dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1}; String res = "NO"; public static void main(String[] args) { Yukicoder20 yuki = new Yukicoder20(); } public Yukicoder20() { Scanner sc = new Scanner(System.in); N = sc.nextInt(); V = sc.nextInt(); Ox = sc.nextInt(); Oy = sc.nextInt(); L = new int[N][N]; dp = new int[N][N][2]; for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { L[j][i] = sc.nextInt(); dp[i][j][0] = -1; dp[i][j][1] = -1; } } search(0, 0, V - L[0][0], 0); System.out.println(res); } public void search(int nowX, int nowY, int nowV, int oasis) { int check = oasis; if (nowV <= 0) return; if (nowX == Ox - 1 && nowY == Oy - 1 && oasis == 0) { nowV *= 2; check = 1; } if (nowV <= dp[nowX][nowY][oasis]) return; if (nowX == N - 1 && nowY == N - 1) res = "YES"; dp[nowX][nowY][check] = nowV; for (int i = 0; i < 4; i++) { int nextX = nowX + dx[i]; int nextY = nowY + dy[i]; if (nextX >= 0 && nextX < N && nextY >= 0 && nextY < N) { search(nextX, nextY, nowV - L[nextX][nextY], check); } } } }