import heapq H,W = map(int,input().split()) U,D,R,L,K,P = map(int,input().split()) move = [(-1,0,U),(1,0,D),(0,1,R),(0,-1,L)] xs,ys,xt,yt = map(int,input().split()) xs,ys,xt,yt = xs-1,ys-1,xt-1,yt-1 lsHW = [input() for i in range(H)] h = [(0,xs,ys)] INF = float('INF') lscost = [[INF]*(W) for i in range(H)] lscost[xs][ys] = 0 while h: co,x,y = heapq.heappop(h) for dx,dy,c in move: if 0<= x+dx < H and 0<= y+dy < W: if lsHW[x+dx][y+dy] == '#': continue if lsHW[x+dx][y+dy] == '@': if lscost[x+dx][y+dy] > lscost[x][y] + c + P: lscost[x+dx][y+dy] = lscost[x][y] + c + P heapq.heappush(h,(lscost[x+dx][y+dy],x+dx,y+dy)) else: if lscost[x+dx][y+dy] > lscost[x][y] + c: lscost[x+dx][y+dy] = lscost[x][y] + c heapq.heappush(h,(lscost[x+dx][y+dy],x+dx,y+dy)) if lscost[xt][yt] <= K: print('Yes') else: print('No')