#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef complex<double> P; typedef pair<int,int> pii; #define REP(i,n) for(ll i=0;i<n;++i) #define REPR(i,n) for(ll i=1;i<n;++i) #define FOR(i,a,b) for(ll i=a;i<b;++i) #define DEBUG(x) cout<<#x<<": "<<x<<endl #define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl #define ALL(a) (a).begin(),(a).end() #define MOD (ll)(1e9+7) #define ADD(a,b) a=((a)+(b))%MOD #define FIX(a) ((a)%MOD+MOD)%MOD bool solve(){ int h,w, a,si,sj,b,gi,gj; cin>>h>>w>>a>>si>>sj>>b>>gi>>gj; vector<vi> 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<pii> 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; }