from collections import deque INF = 1 << 60 H, W = map(int, input().split()) U, D, R, L, K, P = map(int, input().split()) sx, sy, tx, ty = map(lambda x: int(x) - 1, input().split()) C = [input() for _ in range(H)] cost = [[INF for _ in range(W)] for _ in range(H)] cost[sy][sx] = 0 que = deque([(sy, sx)]) direction = [(-1, 0, U), (0, 1, R), (1, 0, D), (0, -1, L)] def valid(y, x): return 0 <= x < W and 0 <= y < H while que: y, x = que.popleft() for dy, dx, ct in direction: ny, nx = y + dy, x + dx if not valid(ny, nx): continue if C[ny][nx] == "#": continue if C[ny][nx] == "@": ct += P if cost[ny][nx] <= cost[y][x] + ct: continue cost[ny][nx] = min(cost[ny][nx], cost[y][x] + ct) que.append((ny, nx)) print("Yes" if cost[ty][tx] <= K else "No")