import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int v = sc.nextInt(); int ox = sc.nextInt() - 1; int oy = sc.nextInt() - 1; int[][] field = new int[n][n]; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { field[i][j] = sc.nextInt(); } } int[][] costs = new int[n][n]; for (int i = 0; i < n; i++) { Arrays.fill(costs[i], Integer.MAX_VALUE); } PriorityQueue queue = new PriorityQueue<>(); queue.add(new Path(0, 0, -field[0][0])); while (queue.size() > 0) { Path p = queue.poll(); if (costs[p.row][p.col] <= p.value + field[p.row][p.col]) { continue; } costs[p.row][p.col] = p.value + field[p.row][p.col]; if (p.row > 0) { queue.add(new Path(p.row - 1, p.col, p.value + field[p.row][p.col])); } if (p.row < n - 1) { queue.add(new Path(p.row + 1, p.col, p.value + field[p.row][p.col])); } if (p.col > 0) { queue.add(new Path(p.row, p.col - 1, p.value + field[p.row][p.col])); } if (p.col < n - 1) { queue.add(new Path(p.row, p.col + 1, p.value + field[p.row][p.col])); } } if (costs[n - 1][n - 1] < v) { System.out.println("YES"); return; } if (ox < 0 && oy < 0) { System.out.println("NO"); return; } if (costs[oy][ox] >= v) { System.out.println("NO"); return; } v -= costs[oy][ox]; v *= 2; for (int i = 0; i < n; i++) { Arrays.fill(costs[i], Integer.MAX_VALUE); } queue.add(new Path(oy, ox, -field[oy][ox])); while (queue.size() > 0) { Path p = queue.poll(); if (costs[p.row][p.col] <= p.value + field[p.row][p.col]) { continue; } costs[p.row][p.col] = p.value + field[p.row][p.col]; if (p.row > 0) { queue.add(new Path(p.row - 1, p.col, p.value + field[p.row][p.col])); } if (p.row < n - 1) { queue.add(new Path(p.row + 1, p.col, p.value + field[p.row][p.col])); } if (p.col > 0) { queue.add(new Path(p.row, p.col - 1, p.value + field[p.row][p.col])); } if (p.col < n - 1) { queue.add(new Path(p.row, p.col + 1, p.value + field[p.row][p.col])); } } if (costs[n - 1][n - 1] < v) { System.out.println("YES"); } else { System.out.println("NO"); } } static class Path implements Comparable { int row; int col; int value; public Path(int row, int col, int value) { this.row = row; this.col = col; this.value = value; } public int compareTo(Path another) { return value - another.value; } } }