import heapq h,w=map(int,input().split()) u,d,r,l,k,p=map(int,input().split()) sy,sx,gy,gx=map(int,input().split()) sy-=1;sx-=1;gy-=1;gx-=1 g=[input() for _ in range(h)] inf=float('inf') dst=[[inf]*w for _ in range(h)] confirmed=[[False]*w for _ in range(h)] q=[] heapq.heappush(q,(0,sy,sx)) while q: cost,y,x=heapq.heappop(q) if confirmed[y][x]: continue confirmed[y][x]=True dst[y][x]=cost dy=[-1,1,0,0] dx=[0,0,1,-1] move_cost=[u,d,r,l] if y!=0: if not confirmed[y-1][x]: if g[y-1][x]=='.': heapq.heappush(q,(cost+u,y-1,x)) elif g[y-1][x]=='@': heapq.heappush(q,(cost+u+p,y-1,x)) if y!=h-1: if not confirmed[y+1][x]: if g[y+1][x]=='.': heapq.heappush(q,(cost+d,y+1,x)) elif g[y+1][x]=='@': heapq.heappush(q,(cost+d+p,y+1,x)) if x!=0: if not confirmed[y][x-1]: if g[y][x-1]=='.': heapq.heappush(q,(cost+l,y,x-1)) elif g[y][x-1]=='@': heapq.heappush(q,(cost+l+p,y,x-1)) if x!=w-1: if not confirmed[y][x+1]: if g[y][x+1]=='.': heapq.heappush(q,(cost+r,y,x+1)) elif g[y][x+1]=='@': heapq.heappush(q,(cost+r+p,y,x+1)) print('Yes' if dst[gy][gx]<=k else 'No')