using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var (h, w, x, y) = (c[0], c[1], c[2], c[3]); --x; --y; var map = NArr(h); var mx = new int[] { -1, 0, 1, 0 }; var my = new int[] { 0, 1, 0, -1 }; var val = (long)map[x][y]; var added = new bool[h, w]; added[x, y] = true; var q = new PriorityQueue<(int x, int y), int>(); for (var d = 0; d < 4; ++d) { var nx = x + mx[d]; var ny = y + my[d]; if (nx < 0 || nx >= h || ny < 0 || ny >= w) continue; if (added[nx, ny]) continue; q.Enqueue((nx, ny), map[nx][ny]); added[nx, ny] = true; } while (q.Count > 0) { var cur = q.Dequeue(); if (val <= map[cur.x][cur.y]) { WriteLine("No"); return; } val += map[cur.x][cur.y]; for (var d = 0; d < 4; ++d) { var nx = cur.x + mx[d]; var ny = cur.y + my[d]; if (nx < 0 || nx >= h || ny < 0 || ny >= w) continue; if (added[nx, ny]) continue; q.Enqueue((nx, ny), map[nx][ny]); added[nx, ny] = true; } } WriteLine("Yes"); } }