from heapq import * N,V,OY,OX = map(int,input().split()) L= [list(map(int,input().split())) for _ in range(N)] OX -= 1 OY -= 1 oasys = (OX,OY) M = [[0] * N for _ in range(N)] M[0][0] = V dir = [[1, 0], [0, 1], [0, -1], [-1, 0]] goal = (N-1,N-1) Q = [(-V,(0,0))] oa = True while Q: d, (x, y) = Q.pop() d = -d if M[x][y] > d: continue for xd, yd in dir: x1 = x + xd y1 = y + yd if 0 <= x1 < N and 0 <= y1 < N: d2 = d - L[x1][y1] if d2 <= 0: continue #print(d, (x1, y1),d2) if M[x1][y1] < d2: M[x1][y1] = d2 if oa and (x1,y1) == oasys: oa = False M[x1][y1] *= 2 #print("o", M[x1][y1]) if (x1,y1) == goal and M[x1][y1] > 0: print("YES") exit() heappush(Q,(-M[x1][y1],(x1, y1))) print("NO")