#include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)< pii; typedef vector vi; typedef vector vll; const int DY[] = {-1,0,1,0}; const int DX[] = {0,1,0,-1}; typedef tuple T; int H, W; bool vis[50][50][3501]; int A, SY, SX, B, GY, GX; string M[50]; bool solve(){ MEM(vis, 0); queue Q; Q.push(T(A, SY, SX)); while(sz(Q)){ int tama, y, x; tie(tama, y, x) = Q.front(); Q.pop(); if(vis[y][x][tama])continue; vis[y][x][tama] = 1; if(y == GY&&x == GX&&tama == B)return 1; rep(i, 4){ int ny = y + DY[i], nx = x + DX[i], ntama = tama; if(ny < 0 || ny>=H || nx<0 || nx>=W)continue; if(M[ny][nx] == '*')ntama++; else ntama--; if(ntama <= 0 || ntama >= 3501)continue; Q.push(T(ntama, ny, nx)); } } return 0; } int main(){ while(cin >> H >> W >> A >> SY >> SX >> B >> GY >> GX){ rep(y, H)cin >> M[y]; puts(solve() ? "Yes" : "No"); } }