from collections import deque H,W = map(int,input().split()) U,D,R,L,K,P = map(int,input().split()) sx,sy,tx,ty = map(int,input().split()) sx -= 1 sy -= 1 tx -= 1 ty -= 1 C = [list(str(input())) for _ in range(H)] move = [(-1,0,U),(1,0,D),(0,1,R),(0,-1,L)] INF = 10**18 que = deque([(sx,sy,0)]) seem = [[INF]*W for _ in range(H)] seem[sx][sy] = 0 while que: x,y,c = que.popleft() for i,j,n in move: h,w = x+i,y+j if 0 <= h < H and 0 <= w < W: if C[h][w] == '#': continue if C[h][w] == '@': n += P if seem[h][w] > c+n: seem[h][w] = c+n que.append((h,w,c+n)) if seem[tx][ty] <= K: print('Yes') else: print('No')