import heapq INF = 1 << 60 h, w = map(int, input().split()) u, d, r, l, k, p = map(int, input().split()) xs, ys, xt, yt = map(int, input().split()) xs -= 1 ys -= 1 xt -= 1 yt -= 1 c = [input() for _ in range(h)] dist = [[[INF for _ in range(2)] for _ in range(w)] for _ in range(h)] dist[xs][ys][0] = 0 dx = [1, 0, -1, 0] dy = [0, 1, 0, -1] cost = [[d, d + p], [r, r + p], [u, u + p], [l, l + p]] hp = [(0, xs, ys, 0)] while len(hp) > 0: cd, cx, cy, ci = heapq.heappop(hp) if dist[cx][cy][ci] < cd: continue for d in range(4): nx = cx + dx[d] if nx < 0 or nx >= h: continue ny = cy + dy[d] if ny < 0 or ny >= w: continue if c[nx][ny] == '#': continue ni = 1 if c[nx][ny] == '@' else 0 if dist[nx][ny][ni] > dist[cx][cy][ci] + cost[d][ni]: dist[nx][ny][ni] = dist[cx][cy][ci] + cost[d][ni] heapq.heappush(hp, (dist[nx][ny][ni], nx, ny, ni)) ans = "Yes" if dist[xt][yt][0] <= k else "No" print(ans)