#include using namespace std; // not... const int MX = 55; const int di[]={-1,0,1,0}, dj[]={0,-1,0,1}; int h,w; int a,si,sj; int b,ti,tj; string t[MX]; int d[MX][MX][2005]; struct dat { int i, j, s;}; int main(){ cin >> h >> w; cin >> a >> si >> sj; cin >> b >> ti >> tj; for(int i=0;i> t[i]; queue q; d[si][sj][a]=1; q.push({si,sj,a}); while(q.size()){ dat nd = q.front(); q.pop(); int i=nd.i; int j=nd.j; int s=nd.s; for(int v=0;v<4;v++){ int ni=i+di[v], nj=j+dj[v]; if(ni<0 || nj<0 || ni>=h || nj>=w) continue; int ns=s; if(t[ni][nj]=='*') ns++; else ns--; if(ns>2000) continue; if(!ns) continue; if(d[ni][nj][ns]) continue; q.push({ni,nj,ns}); d[ni][nj][ns]=1; } } if(d[ti][tj][b]) cout << "Yes" << endl; else cout << "No" << endl; return 0; }