h,w = map(int,input().split()) u,d,r,l,k,p = map(int,input().split()) sx,sy,gx,gy = map(int,input().split()) b = [input() for _ in range(h)] sx -= 1 sy -= 1 gx -= 1 gy -= 1 C = [r,u,l,d] dx = [1,0,-1,0] dy = [0,1,0,-1] INF = 10**18 dist = [[INF]*w for _ in range(h)] #dist[sx][sy] = used[sx][sy] = 0 from heapq import * q = [(0,sx,sy)] ans = INF while q: dv,x,y = heappop(q) if x==gx and y==gy: ans = min(ans,dv) if dist[x][y] <= dv: continue dist[x][y] = min(dist[x][y],dv) for i in range(4): nx = x + dx[i] ny = y + dy[i] if nx < 0 or nx >= h or ny < 0 or ny >= w or b[nx][ny] == "#": continue cost = C[i] if b[nx][ny] == "@": cost += p if dist[nx][ny] <= dv+cost: continue heappush(q, (dv+cost,nx,ny)) print("Yes" if ans <= k else "No")