import sys # sys.setrecursionlimit(200005) int1 = lambda x: int(x)-1 p2D = lambda x: print(*x, sep="\n") def II(): return int(sys.stdin.readline()) def LI(): return list(map(int, sys.stdin.readline().split())) def LI1(): return list(map(int1, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def LLI1(rows_number): return [LI1() for _ in range(rows_number)] def SI(): return sys.stdin.readline().rstrip() dij = [(0, 1), (-1, 0), (0, -1), (1, 0)] # dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)] inf = 10**16 # md = 998244353 md = 10**9+7 from heapq import * t = ".@#" h, w = LI() u, d, r, l, k, p = LI() si, sj, gi, gj = LI1() sij = si*w+sj gij = gi*w+gj cc = [t.index(c) for _ in range(h) for c in SI()] def push(ij, nc): if cc[ij] == 2: return if cc[ij] == 1: nc += p if nc >= dist[ij]: return dist[ij] = nc heappush(hp, (nc, ij)) dist = [inf]*h*w dist[sij] = 0 hp = [(0, sij)] while hp: c, ij = heappop(hp) if ij == gij: break if c > dist[ij]: continue i, j = divmod(ij, w) if i-1 >= 0: push(ij-w, c+u) if i+1 < h: push(ij+w, c+d) if j-1 >= 0: push(ij-1, c+l) if j+1 < w: push(ij+1, c+r) print("Yes" if dist[gij] <= k else "No")