h, w, T = map(int, input().split())
si, sj = map(int, input().split())
gi, gj = map(int, input().split())
si -= 1
sj -= 1
gi -= 1
gj -= 1
A = [list(map(int, input())) for _ in range(h)]
T -= 1
dp = [False] * (h * w * (T + 1))


def f(t, i, j):
    return (t * h + i) * w + j


dp[f(0, si, sj)] = True

di = [0, 1, 0, -1, 0]
dj = [1, 0, -1, 0, 0]
for t in range(T):
    for i in range(h):
        for j in range(w):
            if not dp[f(t, i, j)]:
                continue
            for k in range(4):
                ni = i + di[k]
                nj = j + dj[k]
                if ni < 0 or ni >= h or nj < 0 or nj >= w:
                    continue
                b = (A[ni][nj] - t - 1) % (A[ni][nj] + 1)
                if b != 0:
                    dp[f(t + 1, ni, nj)] = True

if any(dp[f(t, gi, gj)] for t in range(T + 1)):
    print("Yes")
    exit()
else:
    print("No")