from heapq import * 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() for _ in range(h)] xs -= 1 ys -= 1 xt -= 1 yt -= 1 directions = [(-1, 0, u), (1, 0, d), (0, 1, r), (0, -1, l)] inf = 1 << 60 dist = [[inf] * w for _ in range(h)] hq = [(0, xs, ys)] dist[xs][ys] = 0 while hq: d, x, y = heappop(hq) if d > dist[x][y]: continue for dx, dy, dd in directions: nx = x + dx ny = y + dy nd = d + dd if nx == -1 or ny == -1 or nx == h or ny == w: continue if C[nx][ny] == "#": continue if C[nx][ny] == "@": nd += p if dist[nx][ny] > nd: dist[nx][ny] = nd heappush(hq, (nd, nx, ny)) if dist[xt][yt] <= k: print("Yes") else: print("No")