import heapq # 想定解を参考に作成 # ダイクストラ SPFAの違いがわからないorz n, v, ox, oy = (int(i) for i in input().split()) l = [[int(i) for i in input().split()] for i in range(n)] cost = [[0xFFFFFFFF for i in range(n)] for j in range(n)] direction = ((1, 0), (0, 1), (-1, 0), (0, -1)) def solve(x, y): h = [] heapq.heappush(h, (0 << 24) + (0 << 8) + 0) visit = [[False for i in range(n)] for j in range(n)] cost[y][x] = 0 visit[y][x] = True while (h): v = heapq.heappop(h) vx = (v >> 8) & 0x000000FF vy = v & 0x000000FF nowcost = cost[vy][vx] for i in range(4): mx = vx + direction[i][0] my = vy + direction[i][1] if(mx < 0 or my < 0 or mx >= n or my >= n): continue newcost = nowcost + l[my][mx] if cost[my][mx] > newcost: cost[my][mx] = newcost if visit[my][mx] == False: visit[my][mx] = True heapq.heappush(h, (newcost << 24) + (mx << 8) + my) solve(0, 0) if cost[n - 1][n - 1] < v: print("YES") else: if (ox > 0 and oy > 0): if cost[oy - 1][ox - 1] < v: solve(oy - 1, ox - 1) if cost[n - 1][n - 1] < (v - cost[oy - 1][ox - 1]) * 2: print("YES") else: print("NO") else: print("NO") else: print("NO")