from collections import deque h,w = map(int,input().split()) u,d,r,l,k,p = map(int,input().split()) sx,sy,gx,gy = [int(x)-1 for x in input().split()] need = [u,d,r,l] dx = [-1,1,0,0] dy = [0,0,1,-1] C = [input() for i in range(h)] inf = 10**20 cost = [[10**20]*w for i in range(h)] cost[sx][sy] = 0 q = deque([[sx,sy]]) while q: x,y = q.popleft() for i,j,c in zip(dx,dy,need): nx = x+i ny = y+j if 0 <= nx < h and 0 <= ny < w and C[nx][ny] != "#": base = cost[x][y]+c+p*(C[nx][ny]=="@") if base < cost[nx][ny]: cost[nx][ny] = base q.append([nx,ny]) ans = cost[gx][gy] if ans <= k: print("Yes") else: print("No")