from scipy.sparse.csgraph import dijkstra from scipy.sparse import csr_matrix N, V, Ox, Oy = map(int, input().split()) L = [tuple(map(int, input().split())) for _ in range(N)] data, row, col = [], [], [] for y in range(N): for x in range(N): for dx, dy in ((1, 0), (-1, 0), (0, 1), (0, -1)): if 0 <= x + dx < N and 0 <= y + dy < N: data.append(L[y][x]) row.append((y + dy) * N + x + dx) col.append(y * N + x) matr = csr_matrix((data, (row, col)), shape=(N * N, N * N)) way = dijkstra(matr, indices=0).astype(int) flag = way[N * N - 1] < V if (Ox, Oy) != (0, 0): oasis = (Oy - 1) * N + Ox - 1 lo = way[oasis] if lo < V: wayo = dijkstra(matr, indices=oasis).astype(int) flag |= wayo[N * N - 1] < (V - lo) * 2 print('YES' if flag else 'NO')