from heapq import heappop, heappush n, v, oj, oi = map(int, input().split()) oj -= 1 oi -= 1 L = [list(map(int, input().split())) for _ in range(n)] Directions = [(1, 0), (0, 1), (-1, 0), (0, -1)] DP = [[0 for _ in range(n)] for _ in range(n)] DP[0][0] = v H = [(-v, 0, 0, 0)] while H: cv, ci, cj, use = heappop(H) cv *= -1 if cv < DP[ci][cj]: continue if ci == n - 1 and cj == n - 1: break for di, dj in Directions: ni, nj = ci + di, cj + dj nuse = use if 0 <= ni < n and 0 <= nj < n: nv = cv - L[ni][nj] if not use and ni == oi and nj == oj: nv *= 2 nuse = True if nv <= DP[ni][nj]: continue DP[ni][nj] = nv heappush(H, (-nv, ni, nj, nuse)) if DP[-1][-1] == 0: print("NO") else: print("YES")