#include using namespace std; using Int = long long; const char newl = '\n'; template inline void chmin(T1 &a,T2 b){if(a>b) a=b;} template inline void chmax(T1 &a,T2 b){if(a void drop(const T &x){cout< vector read(size_t n){ vector ts(n); for(size_t i=0;i>ts[i]; return ts; } template struct Dijkstra{ struct Edge{ Int to; T cost; Edge(Int to,T cost):to(to),cost(cost){} bool operator<(const Edge &o)const{return cost>o.cost;} }; vector< vector > G; vector ds; vector bs; Dijkstra(Int n):G(n){} void add_edge(Int u,Int v,T c){ G[u].emplace_back(v,c); } void build(Int s){ Int n=G.size(); ds.assign(n,numeric_limits::max()); bs.assign(n,-1); priority_queue pq; ds[s]=0; pq.emplace(s,ds[s]); while(!pq.empty()){ auto p=pq.top();pq.pop(); Int v=p.to; if(ds[v]ds[v]+e.cost){ ds[e.to]=ds[v]+e.cost; bs[e.to]=v; pq.emplace(e.to,ds[e.to]); } } } } T operator[](Int k){return ds[k];} vector restore(Int to){ vector res; if(bs[to]<0) return res; while(~to) res.emplace_back(to),to=bs[to]; reverse(res.begin(),res.end()); return res; } }; //INSERT ABOVE HERE signed main(){ cin.tie(0); ios::sync_with_stdio(0); Int h,w; cin>>h>>w; Int u,d,r,l,k,p; cin>>u>>d>>r>>l>>k>>p; Int ys,xs,yt,xt; cin>>ys>>xs>>yt>>xt; ys--;xs--;yt--;xt--; auto idx=[&](Int y,Int x){return y*w+x;}; auto C=read(h); Dijkstra G(h*w); for(Int i=0;i=0){ Int ni=i-1,nj=j+0; Int c=u+p*(C[ni][nj]=='@'); if(C[ni][nj]!='#') G.add_edge(idx(i,j),idx(ni,nj),c); } if(i+1=0){ Int ni=i-0,nj=j-1; Int c=l+p*(C[ni][nj]=='@'); if(C[ni][nj]!='#') G.add_edge(idx(i,j),idx(ni,nj),c); } } } G.build(idx(ys,xs)); cout<<(G[idx(yt,xt)]<=k?"Yes":"No")<