#include using namespace std; int main(){ int H, W; cin >> H >> W; int U, D, R, L; long long K; int P; cin >> U >> D >> R >> L >> K >> P; int xs, ys, xt, yt; cin >> xs >> ys >> xt >> yt; xs--; ys--; xt--; yt--; vector> C(H, vector(W)); for (int i = 0; i < H; i++){ for (int j = 0; j < W; j++){ cin >> C[i][j]; } } vector> d(H, vector(W, -1)); priority_queue, vector>, greater>> pq; pq.push(make_tuple(0, xs, ys)); while (!pq.empty()){ long long dd = get<0>(pq.top()); int x = get<1>(pq.top()); int y = get<2>(pq.top()); pq.pop(); if (d[x][y] == -1){ d[x][y] = dd; if (x > 0){ if (C[x - 1][y] == '.'){ pq.push(make_tuple(dd + U, x - 1, y)); } if (C[x - 1][y] == '@'){ pq.push(make_tuple(dd + U + P, x - 1, y)); } } if (x < H - 1){ if (C[x + 1][y] == '.'){ pq.push(make_tuple(dd + D, x + 1, y)); } if (C[x + 1][y] == '@'){ pq.push(make_tuple(dd + D + P, x + 1, y)); } } if (y < W - 1){ if (C[x][y + 1] == '.'){ pq.push(make_tuple(dd + R, x, y + 1)); } if (C[x][y + 1] == '@'){ pq.push(make_tuple(dd + R + P, x, y + 1)); } } if (y > 0){ if (C[x][y - 1] == '.'){ pq.push(make_tuple(dd + L, x, y - 1)); } if (C[x][y - 1] == '@'){ pq.push(make_tuple(dd + L + P, x, y - 1)); } } } } if (d[xt][yt] != -1 && d[xt][yt] <= K){ cout << "Yes" << endl; } else { cout << "No" << endl; } }