from heapq import heapify,heappop,heappush H,W=map(int,input().split()) U,D,R,L,K,P=map(int,input().split()) xs,ys,xt,yt=map(int,input().split()) C=["*"*(W+2)] for _ in range(H): C.append("*"+input()+"*") C.append("*"*(W+2)) inf=float("inf") DP=[[inf]*(W+2) for _ in range(H+2)]; DP[xs][ys]=0 Q=[(0,(xs,ys))] V=[((1,0),U),((-1,0),D),((0,1),R),((0,-1),L)] while Q: d,(x,y)=heappop(Q) if DP[x][y]>d: continue if x==xt and y==yt: break for (a,b),c in V: if 1<=x+a<=H and 1<=y+b<=W and C[x+a][y+b]!="#": if C[x+a][y+b]==".": m=d+c else: m=d+c+P else: continue if DP[x+a][y+b]>m: DP[x+a][y+b]=m heappush(Q,(m,(x+a,y+b))) print("Yes" if DP[xt][yt]<=K else "No")