from queue import PriorityQueue N,V,Ox,Oy = list(map(int, input().split(' '))) desert = [] for _ in range(N): desert.append(list(map(int, input().split(' ')))) distance = [] for _ in range(N): distance.append([float('inf') for _ in range(N)]) def dijkstra(sx,sy): dx = [1, 0, -1, 0] dy = [0, 1, 0, -1] distance[sy][sx] = 0 que = PriorityQueue() que.put((0,sx,sy)) while not que.empty(): v,x,y = que.get() for i in range(len(dx)): nx = x + dx[i] ny = y + dy[i] if 0 <= nx and nx < N and 0 <= ny and ny < N: nv = v + desert[ny][nx] if nv < distance[ny][nx]: distance[ny][nx] = nv que.put((nv,nx,ny)) dijkstra(0,0) if distance[N-1][N-1] < V: print('YES') exit(0) if Ox == 0 and Oy == 0: print('NO') exit(0) ov = (V - distance[Oy-1][Ox-1]) * 2 dijkstra(Ox-1,Oy-1) if 0 < ov - distance[N-1][N-1]: print('YES') else: print('NO')