from heapq import * H, W = map(int, input().split()) U,D,R,L,K,P = map(int,input().split()) xs,ys,xg,yg = map(int,input().split()) xs -= 1 ys -= 1 xg -= 1 yg -= 1 S = [input() for _ in range(H)] dir = ((D,(1, 0)), (R,(0, 1)), (L,(0, -1)), (U,(-1, 0))) q = [(0, xs,ys)] cnt = 0 D2 = [[K + 1] * W for _ in range(H)] def dijkstra(): D2[xs][ys] = 0 q = [(0,xs,ys)] while q: d, x,y = heappop(q) if d > D2[x][y]: continue for dd,(xd,yd) in dir: x1 = x + xd y1 = y + yd if 0 <= x1 < H and 0 <= y1 < W: if S[x1][y1] == ".": if D2[x1][y1] > d + dd: D2[x1][y1] = d + dd heappush(q, (D2[x1][y1],x1,y1)) elif S[x1][y1] == "@": if D2[x1][y1] > d + P + dd: D2[x1][y1] = d + P + dd heappush(q, (D2[x1][y1],x1,y1)) return dijkstra() if D2[xg][yg] <= K: print("Yes") else: print("No")