import sys input = sys.stdin.readline import heapq H,W=map(int,input().split()) U,D,R,L,K,P=map(int,input().split()) xs,ys,xt,yt=map(int,input().split()) MAP=[input().strip() for i in range(H)] DP=[[1<<60]*W for i in range(H)] xs-=1 xt-=1 ys-=1 yt-=1 Q=[(0,xs,ys)] while Q: cost,x,y=heapq.heappop(Q) if cost>DP[x][y]: continue for z,w,cp in [(x+1,y,D),(x-1,y,U),(x,y+1,R),(x,y-1,L)]: if 0<=zcost+cp: DP[z][w]=cost+cp heapq.heappush(Q,(cost+cp,z,w)) elif MAP[z][w]=="@" and DP[z][w]>cost+cp+P: DP[z][w]=cost+cp+P heapq.heappush(Q,(cost+cp+P,z,w)) if DP[xt][yt]<=K: print("Yes") else: print("No")