H,W = map(int,input().split()) U,D,R,L,K,P = map(int,input().split()) cost = [U,D,R,L] move = ((-1,0),(1,0),(0,1),(0,-1)) def f(n): return int(n)-1 xs,ys,xt,yt = map(f,input().split()) C = [list(input()) for _ in range(H)] import heapq que = [] que.append((0,xs,ys)) inf = float("inf") d = [[inf for _ in range(W)] for _ in range(H)] d[xs][ys] = 0 need = inf while len(que) != 0: n,i,j = heapq.heappop(que) if d[i][j] < n: continue if i == xt and j == yt: need = d[i][j] break for k in range(4): a,b = move[k] ni,nj = i + a , j + b if ni < 0 or ni >= H or nj < 0 or nj >= W: continue if C[ni][nj] == "#": continue next = d[i][j] + cost[k] if C[ni][nj] == "@": next += P if d[ni][nj] <= next: continue d[ni][nj] = next heapq.heappush(que,(next,ni,nj)) if need <= K: print("Yes") else: print("No")