from sys import stdin from heapq import heappush, heappop h, w = [int(x) for x in stdin.readline().rstrip().split()] u, d, r, l, k, p = [int(x) for x in stdin.readline().rstrip().split()] xs, ys, xt, yt = [int(x) for x in stdin.readline().rstrip().split()] c = [stdin.readline().rstrip() for _ in range(h)] kabe = ["#" for i in range(w+2)] data = [kabe] for i in range(h): kari = ["#"] for j in range(w): kari.append(c[i][j]) kari.append("#") data.append(kari) data.append(kabe) hq = [(0,xs,ys)] infty = 10**18 dist = [[infty for i in range(w+2)] for j in range(h+2)] done = [[False for i in range(w+2)] for j in range(h+2)] dist[xs][ys] = 0 while hq: cost, nowx, nowy = heappop(hq) if not done[nowx][nowy]: if (nowx == xt) & (nowy == yt): if cost <= k: print("Yes") else: print("No") exit() done[nowx][nowy] = True if (data[nowx-1][nowy] != "#") & (not done[nowx-1][nowy]): nextcost = cost + u if data[nowx-1][nowy] == "@": nextcost += p if (dist[nowx-1][nowy] > nextcost): dist[nowx-1][nowy] = nextcost heappush(hq, (nextcost, nowx-1, nowy)) if (data[nowx+1][nowy] != "#") & (not done[nowx+1][nowy]): nextcost = cost + d if data[nowx+1][nowy] == "@": nextcost += p if (dist[nowx+1][nowy] > nextcost): dist[nowx+1][nowy] = nextcost heappush(hq, (nextcost, nowx+1, nowy)) if (data[nowx][nowy-1] != "#") & (not done[nowx][nowy-1]): nextcost = cost + l if data[nowx][nowy-1] == "@": nextcost += p if (dist[nowx][nowy-1] > nextcost): dist[nowx][nowy-1] = nextcost heappush(hq, (nextcost, nowx, nowy-1)) if (data[nowx][nowy+1] != "#") & (not done[nowx][nowy+1]): nextcost = cost + r if data[nowx][nowy+1] == "@": nextcost += p if (dist[nowx][nowy+1] > nextcost): dist[nowx][nowy+1] = nextcost heappush(hq, (nextcost, nowx, nowy+1)) print("No")