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 start = (0,0) goal = (N-1,N-1) oasys = (OX,OY) INF = 10 ** 6 dir = [[1, 0], [0, 1], [0, -1], [-1, 0]] def dijkstra(B,E,V0): M = [[INF] * N for _ in range(N)] M[B[0]][B[1]] = 0 Q = [(0,B)] while Q: d, (x, y) = heappop(Q) #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 >= V0: continue if M[x1][y1] > d2: M[x1][y1] = d2 if (x1,y1) == E: return M[x1][y1] heappush(Q,(d2,(x1, y1))) return INF if dijkstra(start,goal,V) < V: print("YES") else: a = dijkstra(start,oasys,V) if a >= V: print("NO") else: b = dijkstra(oasys,goal,2 * (V-a)) if b < 2 * (V - a): print("YES") else: print("NO")