from heapq import heappop, heappush h, w = map(int, input().split()) u, d, r, l, k, p = map(int, input().split()) si, sj, ti, tj = map(int, input().split()) si -= 1 sj -= 1 ti -= 1 tj -= 1 S = [list(input()) for _ in range(h)] DP = [[k + 1 for _ in range(w)] for _ in range(h)] Directions = [(-1, 0), (1, 0), (0, 1), (-1, 0)] C = [u, d, r, l] DP[si][sj] = 0 H = [(0, si, sj)] while H: cc, ci, cj = heappop(H) if cc > DP[ci][cj]: continue for i in range(4): nc = cc di, dj = Directions[i] ni, nj = ci + di, cj + dj if 0 <= ni < h and 0 <= nj < w: if S[ni][nj] == '#': continue elif S[ni][nj] == '@': nc += p nc += C[i] if nc >= DP[ni][nj]: continue DP[ni][nj] = nc heappush(H, (nc, ni, nj)) if DP[ti][tj] == k + 1: print("No") else: print("Yes")