import heapq 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 = tuple(input() for _ in range(H)) INF = 10**18 dist = [[INF] * W for _ in range(H)] dist[xs][ys] = 0 que = [(0, xs, ys)] while que: c, x, y = heapq.heappop(que) if dist[x][y] < c: continue for dx, dy, cost in ((0, 1, R), (0, -1, L), (1, 0, D), (-1, 0, U)): nx, ny = x + dx, y + dy if 0 <= nx < H and 0 <= ny < W: if C[nx][ny] == "#": continue elif C[nx][ny] == "@": cost += P if dist[x][y] + cost < dist[nx][ny]: dist[nx][ny] = dist[x][y] + cost heapq.heappush(que, (dist[nx][ny], nx, ny)) print("Yes" if dist[xt][yt] <= K else "No")