import heapq def main(): H, W = map(int, input().split()) u,d,r,l,k,p = map(int, input().split()) x1, x2, y1, y2 = [i-1 for i in list(map(int, input().split()))] c = [input() for i in range(H)] seen = [[False]*W for _ in range(H)] costs = [u, d, r, l] directions = [(-1, 0), (1, 0), (0, 1), (0, -1)] hq = [] hq.append((0, x1, x2)) while hq: cost, h, w = heapq.heappop(hq) if h == y1 and w == y2: if cost <= k: return True else: return False if not seen[h][w]: seen[h][w] = True for idx, (dh, dw) in enumerate(directions): if 0 <= h+dh < H and 0 <= w+dw < W and not seen[h+dh][w+dw]: if c[h+dh][w+dw] == ".": heapq.heappush(hq, (cost + costs[idx], h+dh, w+dw)) elif c[h+dh][w+dw] == "@": heapq.heappush(hq, (cost + costs[idx] + p, h+dh, w+dw)) return False if main(): print("Yes") else: print("No")