import sys,collections,heapq sys.setrecursionlimit(10**7) def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI2(): return list(map(int,sys.stdin.readline().rstrip())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) def LS2(): return list(sys.stdin.readline().rstrip()) class Dijkstra: def __init__(self): self.e = collections.defaultdict(list) def add(self, u, v, d, directed=False): if directed is False: # 無向グラフの場合 self.e[u].append([v, d]) self.e[v].append([u, d]) else: # 有向グラフの場合 self.e[u].append([v, d]) def delete(self, u, v): self.e[u] = [_ for _ in self.e[u] if _[0] != v] self.e[v] = [_ for _ in self.e[v] if _[0] != u] def search(self, s): # sから各頂点までの最短距離 d = collections.defaultdict(lambda: float('inf')) d[s] = 0 q = [] heapq.heappush(q, (0, s)) v = collections.defaultdict(bool) while len(q): k, u = heapq.heappop(q) if v[u]: continue v[u] = True for uv, ud in self.e[u]: if v[uv]: continue vd = k + ud if d[uv] > vd: d[uv] = vd heapq.heappush(q, (vd, uv)) return d N,V,Ox,Oy = MI() L = [LI() for _ in range(N)] Di = Dijkstra() for i in range(N): for j in range(N): l = L[i][j] if i >= 1: Di.add((i-1,j),(i,j),l,directed=True) if i <= N-2: Di.add((i+1,j),(i,j),l,directed=True) if j >= 1: Di.add((i,j-1),(i,j),l,directed=True) if j <= N-2: Di.add((i,j+1),(i,j),l,directed=True) dist = Di.search((0,0)) if (Ox,Oy) == (0,0): if dist[(N-1,N-1)] < V: print('YES') else: print('NO') else: Ox -= 1 Oy -= 1 a = dist[(Ox,Oy)] b = Di.search((N-1,N-1))[(Ox,Oy)]-L[Ox][Oy]+L[-1][-1] c = dist[(N-1,N-1)] if c < V or (a < V and b < 2*(V-a)): print('YES') else: print('NO')