import heapq import sys input = sys.stdin.readline sys.setrecursionlimit(10 ** 7) inf = 10 ** 18 H, W = map(int, input().split()) U, D, R, L, K, P = map(int, input().split()) xs, ys, xt, yt = map(lambda x: int(x)-1, input().split()) C = [input().rstrip() for _ in range(H)] dydx4 = ((0, 1, R), (1, 0, D), (-1, 0, U), (0, -1, L)) dist = [[inf] * W for _ in range(H)] dist[xs][ys] = 0 que = [(0, xs, ys)] while que: ds, x, y = heapq.heappop(que) if dist[x][y] < ds: continue for dx, dy, dt in dydx4: nx = x + dx ny = y + dy if 0 <= nx < H and 0 <= ny < W and C[nx][ny] != "#": cost = ds + dt + P * (C[nx][ny] == "@") if dist[nx][ny] > cost: dist[nx][ny] = cost heapq.heappush(que, (cost, nx, ny)) goal = dist[xt][yt] if goal <= K: print("Yes") else: print("No")