#include<iostream>
#include<queue>
using namespace std;

#define pii pair<int, int> 
#define mk make_pair
const int N = 1505;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};

int H, W, K, L;
int x1, x2, y11, y2;
char mp[N][N];
bool vis[N][N];
int p[N][N], s[N][N];
int u[N][N], d[N][N];
pii st;

bool bfs(pii ss){
    queue<pii> q;
    q.push(ss);
    while(!q.empty()){
        pii now = q.front();
        q.pop();
        int xx = now.first;
        int yy = now.second;
        if(mp[xx][yy] == '*') return true;
        if(vis[xx][yy]) continue;
        vis[xx][yy] = 1;
        for(int i = 0;i < 4;i ++){
            int nx = xx + dx[i];
            int ny = yy + dy[i];
            if(nx < 1 || ny < 1 || nx > H || ny > W || mp[nx][ny] == 'X') continue;
            if(dx[i] != 0){
                if(min(u[xx][yy], u[nx][yy]) + min(d[xx][yy], d[nx][yy]) > K){
                    q.push(mk(nx, ny));
                }
            }
            if(dy[i] != 0){
                if(min(p[xx][yy], p[xx][ny]) + min(s[xx][yy], s[xx][ny]) > L){
                    q.push(mk(nx, ny));
                }
            }
        }
    }
    return false;
}

int main(){

    cin >> W >> H >> K >> L;

    cin >> x1 >> y11 >> x2 >> y2;

    for(int i = 1;i <= H;i ++){
        for(int j = 1;j <= W;j ++){
            cin >> mp[i][j];
        }
    }
    for(int i = 1;i <= H;i ++){
        for(int j = 1;j <= W;j ++){
            if(mp[i][j] != 'X'){
                p[i][j] = p[i - 1][j] + 1;
                u[i][j] = u[i][j - 1] + 1;
            }
        }
    }
    for(int i = H;i >= 1;i --){
        for(int j = W;j >= 1;j --){
            if(mp[i][j] != 'X'){
                s[i][j] = s[i + 1][j] + 1;
                d[i][j] = d[i][j + 1] + 1;
            }
        }
    }
    st = mk(y11 + 1, x2 + 1);
    if(bfs(st)) cout << "YES\n";
    else cout << "NO\n";
    return 0;
}