import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random #sys.setrecursionlimit(10**9) #sys.set_int_max_str_digits(0) input = sys.stdin.readline #n = int(input()) #alist = list(map(int,input().split())) #alist = [] #s = input() h,w,T = map(int,input().split()) #for i in range(n): # alist.append(list(map(int,input().split()))) sx,sy = map(lambda x:int(x)-1,input().split()) gx,gy = map(lambda x:int(x)-1,input().split()) grid = [list(map(int,list(input().rstrip()))) for i in range(h)] start = (sx,sy,0) d = collections.deque() dist = [[[10**18 for i in range(210)] for j in range(w)] for feufr in range(h)] d.append(start) dist[sx][sy][0] = 0 dxy = [[-1,0],[1,0],[0,-1],[0,1],[0,0]] while d: x,y,t = d.popleft() for dx,dy in dxy: if 0 <= x+dx < h and 0 <= y+dy < w: z = grid[x+dx][y+dy] zz = (z - (t + 1)) % (z + 1) if zz >= 1 and dist[x+dx][y+dy][(t+1)%210] > dist[x][y][t] + 1: dist[x+dx][y+dy][(t+1)%210] = dist[x][y][t] + 1 d.append((x+dx,y+dy,(t+1)%210)) ans = 10**18 for i in range(210): ans = min(ans,dist[gx][gy][i]) print('Yes' if ans <= T else 'No')