h,w = map(int,input().split()) u,d,r,l,k,p = map(int,input().split()) sy,sx,gy,gx = map(int,input().split()) from sys import stdin grid = [stdin.readline()[:-1] for _ in range(h)] import heapq for i in range(h): grid[i] = list(grid[i]) hq = [(0,sx,sy)] heapq.heapify(hq) shortest = [[False for _ in range(w)] for _ in range(h)] answer = [[10**13+1 for _ in range(w)] for _ in range(h)] while hq: cost,xax,yax = heapq.heappop(hq) if shortest[yax-1][xax-1]: continue shortest[yax-1][xax-1] = True answer[yax-1][xax-1] = cost if xax != 1: if not shortest[yax-1][xax-2]: if grid[yax-1][xax-2] == '.': heapq.heappush(hq,(cost+l,xax-1,yax)) elif grid[yax-1][xax-2] == '@': heapq.heappush(hq,(cost+l+p,xax-1,yax)) if xax != w: if not shortest[yax-1][xax]: if grid[yax-1][xax] == '.': heapq.heappush(hq,(cost+r,xax+1,yax)) elif grid[yax-1][xax] == '@': heapq.heappush(hq,(cost+r+p,xax+1,yax)) if yax != 1: if not shortest[yax-2][xax-1]: if grid[yax-2][xax-1] == '.': heapq.heappush(hq,(cost+u,xax,yax-1)) elif grid[yax-2][xax-1] == '@': heapq.heappush(hq,(cost+u+p,xax,yax-1)) if yax != h: if not shortest[yax][xax-1]: if grid[yax][xax-1] == '.': heapq.heappush(hq,(cost+d,xax,yax+1)) elif grid[yax][xax-1] == '@': heapq.heappush(hq,(cost+d+p,xax,yax+1)) if answer[gy-1][gx-1] <= k: print('Yes') else: print('No')