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]m: DP[x+a][y+b]=m heappush(Q,(m,(x+a,y+b))) print("Yes" if DP[xt][yt]<=K else "No")