import heapq 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 = [list(input()) for _ in range(h)] q = ([(0,xs-1,ys-1)]) vecs = [(1,0,d),(-1,0,u),(0,1,r),(0,-1,l)] vis = [[10 ** 15] * w for _ in range(h)] while q: cost,x,y = heapq.heappop(q) if cost < vis[x][y]: vis[x][y] = cost for vx,vy,vc in vecs: nx,ny = x + vx,y + vy if nx >= 0 and nx <= h-1 and ny >= 0 and ny <= w-1: if c[nx][ny] != "#": if c[nx][ny] == "@": vc += p heapq.heappush(q,(cost+vc,nx,ny)) if vis[xt-1][yt-1] <= k: print("Yes") else: print("No")