import sys input = sys.stdin.readline from heapq import * def dijkstra(): dist = [[10**18]*W for _ in range(H)] dist[xs-1][ys-1] = 0 pq = [(0, (xs-1)*10000+ys-1)] while pq: d, xy = heappop(pq) x, y = divmod(xy, 10000) for nx, ny, c in [(x-1, y, U), (x+1, y, D), (x, y-1, L), (x, y+1, R)]: if 0<=nxdist[x][y]+c: dist[nx][ny] = dist[x][y]+c heappush(pq, (dist[nx][ny], nx*10000+ny)) return dist[xt-1][yt-1]<=K H, W = map(int, input().split()) U, D, R, L, K, P = map(int, input().split()) xs, ys, xt, yt = map(int, input().split()) C = [input()[:-1] for _ in range(H)] if dijkstra(): print('Yes') else: print('No')