from heapq import heappush, heappop n, v, ox, oy = map(int, input().split()) field = [list(map(int, input().split())) for _ in range(n)] INF = 40000 q = [] first = [[-INF] * n for _ in range(n)] second = [[-INF] * n for _ in range(n)] heappush(q, (-v, 0)) first[0][0] = v while q: life, pos = heappop(q) life = -life y = pos // 1000 x = pos % 1000 for dy, dx in [(-1, 0), (0, -1), (1, 0), (0, 1)]: ny = y + dy nx = x + dx if ny < n and nx < n and first[ny][nx] == -INF: first[ny][nx] = life - field[ny][nx] heappush(q, (-first[ny][nx], ny * 1000 + nx)) if ox != 0 or oy != 0: oy -= 1 ox -= 1 second[oy][ox] = first[oy][ox] * 2 heappush(q, (-second[oy][ox], oy * 1000 + ox)) while q: life, pos = heappop(q) life = -life y = pos // 1000 x = pos % 1000 for dy, dx in [(-1, 0), (0, -1), (1, 0), (0, 1)]: ny = y + dy nx = x + dx if ny < n and nx < n and second[ny][nx] == -INF: second[ny][nx] = life - field[ny][nx] heappush(q, (-second[ny][nx], ny * 1000 + nx)) print("YES" if first[n - 1][n - 1] > 0 or second[n - 1][n - 1] > 0 else "NO")