#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define endl '\n'
#define Valerian void
#define Valerian_or_Habil ios::sync_with_stdio(false); cin.tie(0);
using namespace std;
int dx[4]={0,0,-1,1};
int dy[4]={-1,1,0,0};
int pref[305][305];
string g[305];
int get(int x1,int y1,int x2,int y2){
return pref[y2][x2]
- (x1?pref[y2][x1-1]:0)
- (y1?pref[y1-1][x2]:0)
+ (x1&&y1?pref[y1-1][x1-1]:0);
}
int dista[305][305][305][305];
Valerian solve(){
int W,H,K,L;
cin>>W>>H>>K>>L;
int hx,hy,vx,vy;
cin>>hx>>hy>>vx>>vy;
for(int i=0;i<H;i++) cin>>g[i];
int tx=-1,ty=-1;
for(int i=0;i<H;i++)
for(int j=0;j<W;j++)
if(g[i][j]=='*') ty=i,tx=j;
for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
pref[i][j]=(g[i][j]=='X');
if(i) pref[i][j]+=pref[i-1][j];
if(j) pref[i][j]+=pref[i][j-1];
if(i&&j) pref[i][j]-=pref[i-1][j-1];
}
}
memset(dista,-1,sizeof(dista));
queue<array<int,4>> q;
q.push({hx,hy,vx,vy});
dista[hx][hy][vx][vy]=0;
while(!q.empty()){
auto cur=q.front(); q.pop();
int xh=cur[0], yh=cur[1], xv=cur[2], yv=cur[3];
int cx=xv, cy=yh;
if(cx==tx && cy==ty){
cout<<"YES"<<endl;
return;
}
for(int i=0;i<4;i++){
int nxh=xh+dx[i], nyh=yh+dy[i];
if(nxh>=0 && nxh+K-1<W && nyh>=0 && nyh<H){
if(get(nxh,nyh,nxh+K-1,nyh)==0){
int ix=xv, iy=nyh;
if(ix>=nxh && ix<=nxh+K-1 && iy>=yv && iy<=yv+L-1){
if(dista[nxh][nyh][xv][yv]==-1){
dista[nxh][nyh][xv][yv]=1;
q.push({nxh,nyh,xv,yv});
}
}
}
}
}
for(int i=0;i<4;i++){
int nxv=xv+dx[i], nyv=yv+dy[i];
if(nxv>=0 && nxv<W && nyv>=0 && nyv+L-1<H){
if(get(nxv,nyv,nxv,nyv+L-1)==0){
int ix=nxv, iy=yh;
if(ix>=xh && ix<=xh+K-1 && iy>=nyv && iy<=nyv+L-1){
if(dista[xh][yh][nxv][nyv]==-1){
dista[xh][yh][nxv][nyv]=1;
q.push({xh,yh,nxv,nyv});
}
}
}
}
}
}
cout<<"NO"<<endl;
}
int main(){
Valerian_or_Habil;
solve();
}