import sys input=lambda:sys.stdin.readline().rstrip() class node: def __init__(self,con): self.con=con class directedWeightedGraph: def __init__(self,N,edges=[]): self.N=N self.nodes=[node([]) for i in range(N)] for i in edges: self.nodes[i[0]].append(i[1:]) def connect(self,f,t,weight=0): self.nodes[f].con.append([t,weight]) def dijkstra(self,start): ans=[float('inf') for i in range(self.N)] ans[start]=0 watch=[start] while len(watch): cur=watch[-1] watch.pop() for i in self.nodes[cur].con: if ans[i[0]]>ans[cur]+i[1]: ans[i[0]]=ans[cur]+i[1] watch.append(i[0]) return ans O=[] N,V,*O=map(int,input().split()) O[0]-=1 O[1]-=1 L=[list(map(int,input().split())) for i in range(N)] G=directedWeightedGraph(N**2) for i in range(N-1): for j in range(N): G.connect(i*N+j,i*N+j+N,L[i+1][j]) G.connect(i*N+j+N,i*N+j,L[i][j]) G.connect(j*N+i+1,j*N+i,L[j][i]) G.connect(j*N+i,j*N+i+1,L[j][i+1]) A=G.dijkstra(0) if A[N**2-1]0 and V>A[O[0]*N+O[1]]: print(['NO','YES'][G.dijkstra(N**2-1)[O[0]*N+O[1]]<(V-A[O[0]*N+O[1]])*2]) else: print('NO')