#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define Pr pair<ll,ll>
#define Tp tuple<ll,ll,ll>
using Graph = vector<vector<int>>;
#define double long double

const ll mod = 1000000007;


//dfs
//s:始点 i:dfs回数 t:始点からの距離
vector<int> vis; int t;
vector<int> depth;
//探索範囲を距離L以下に制限する場合
int L;
vector<ll> cnt(100001,0);
void dfs(Graph &G, int s,int i){
    int ti = t;
    t++;
    for(int nx:G[s]){
        if(t>=L) break;
        if(vis[nx]==i) continue;
        depth[nx] = depth[s] + 1;
        vis[nx] = i;
        dfs(G,nx,i);
    }
    t++;
    cnt[s] = (t-ti)/2;
}
    

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    ll H,W; cin >> H >> W;
    ll U,D,R,L,K,P; cin >> U >> D >> R >> L >> K >> P;
    ll cost[H][W];
    rep(i,H){
        rep(j,W) cost[i][j] = 2e18;
    }
    ll xs,xt,ys,yt; cin >> xs >> ys >> xt >> yt;
    cost[xs-1][ys-1] = 0;
    char g[H][W];
    rep(i,H){
        rep(j,W) cin >> g[i][j];
    }
    //Dijkstra (普通のダイクストラ)
    priority_queue<Tp, vector<Tp>, greater<Tp>> go;
    ll inf = 2e18;
    go.push(make_tuple(0,xs-1,ys-1)); 
    Tp p;
    vector<pair<int,int>> step;
    step.push_back(make_pair(-1,0));
    step.push_back(make_pair(0,-1));
    step.push_back(make_pair(1,0));
    step.push_back(make_pair(0,1));
    vector<ll> cs = {U,L,D,R};
    while(!go.empty()){
        p = go.top(); go.pop();
        auto[c,x,y] = p;
        if(c>cost[x][y]) continue;
        rep(i,4){
            ll z = x+step[i].first;
            ll w = y+step[i].second;
            if(0>z||z>=H||0>w||W<=w) continue;
            if(g[z][w]=='#') continue;
            ll cc = cost[x][y];
            if(g[z][w]=='@') cc += P;
            if(cc+cs[i]<cost[z][w]){
                cost[z][w] = cc+cs[i];
                go.push(make_tuple(cost[z][w],z,w));
                // cout << z << " " << w << endl;
                // cout << cost[z][w] << endl;
            }
        }
    }
    //cout << cost[xt-1][yt-1] << endl;
    string ans = "Yes";
    if(cost[xt-1][yt-1]>K) ans = "No";
    cout << ans << endl;
}