import sys input = sys.stdin.readline from collections import * M = 605 def f(h, w, t): return h * W * M + w * M + t def g(v): t = v % M v //= M h, w = divmod(v, W) return h, w, t H, W, T = map(int, input().split()) sx, sy = map(int, input().split()) gx, gy = map(int, input().split()) sx, sy, gx, gy = sx - 1, sy - 1, gx - 1, gy - 1 A = [] for i in range(H): L = list(input().rstrip()) L = list(map(int, L)) A.append(L) seen = [0] * H * W * (M+1) Q = deque() Q.append(f(sx, sy, 0)) seen[f(sx, sy, 0)] = 1 dx = [1, 0, -1, 0, 0] dy = [0, 1, 0, -1, 0] while Q: v = Q.popleft() h, w, t = g(v) if t == T: break if h == gx and w == gy: print("Yes") exit() for k in range(5): x = h + dx[k] y = w + dy[k] if x < 0 or x > H - 1 or y < 0 or y > W - 1: continue b = (A[x][y] - t - 1) % (A[x][y] + 1) if b == 0 or seen[f(x, y, t+1)]: continue seen[f(x, y, t+1)] = 1 Q.append(f(x, y, t+1)) print("No")