#include using namespace std; typedef long long ll; typedef vector vi; typedef vector vl; typedef complex P; typedef pair pii; #define REP(i,n) for(ll i=0;i>h>>w>>a>>si>>sj>>b>>gi>>gj; vector mp(h,vi(w,0)); REP(i,h){ string s; cin>>s; REP(j,w)if(s[j]=='*')mp[i][j]=1; } if( (abs(si-gi)+abs(sj-gj)+abs(a-b))%2 != 0 )return false; queue q; vi lb(h*w,-1),ub(h*w,-1); lb[si*w+sj] = ub[si*w+sj] = a; q.push(make_pair(si*w+sj,a)); int dx[4] = {1,0,-1,0}; int dy[4] = {0,1,0,-1}; while(!q.empty()){ pii p = q.front();q.pop(); int y = p.first/w; int x = p.first%w; int c = p.second; REP(i,4){ int ny = y + dy[i]; int nx = x + dx[i]; if(ny<0 || nx<0 || ny>=h || nx>=w)continue; int nc = c + (mp[ny][nx]==1?1:-1); if(nc > 2000)continue; if(nc <= 0)continue; int id = ny*w+nx; if(lb[id] <= nc && nc <= ub[id])continue; if(lb[id]==-1)lb[id]=nc; lb[id] = min(lb[id],nc); ub[id] = max(ub[id],nc); q.push(make_pair(id,nc)); } } int gid = gi*w+gj; if(lb[gid]<=b && b<=ub[gid])return true; else return false; } int main(){ cout << (solve()?"Yes":"No") << endl; return 0; }