#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)

int h,w,r,c;

enum DIR { L, U, R, D };
int di[] = { 0, -1, 0, 1 };
int dj[] = { -1, 0, 1, 0 };
int open[510][510][4];
int win[510][510];

bool inner(int i, int j){
    return i >= 0 && j >= 0 && i < h && j < w;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    while(cin >> h >> w >> r >> c && h){
        --r; --c;
        memset(win, 0, sizeof win);
        memset(open, 0, sizeof open);
        rep(i,h*2+1){
            if(i%2 == 0){
                rep(j,w){
                    int x;
                    cin >> x;
                    open[i/2][j][U] = !x;
                    if(i/2) open[i/2-1][j][D] = !x;
                }
            } else {
                rep(j,w+1){
                    int x;
                    cin >> x;
                    open[i/2][j][L] = !x;
                    if(j) open[i/2][j-1][R] = !x;
                }
            }
        }
        queue<pair<int,int>> q;
        rep(i,h)rep(j,w) q.emplace(i,j);
        while(q.size()){
            int ci,cj;
            tie(ci,cj) = q.front();
            q.pop();
            int cnt[2] = {};
            if(win[ci][cj]) continue;
            rep(d,4){
                int ni = ci + di[d];
                int nj = cj + dj[d];
                if(!inner(ni,nj) || win[ni][nj]){
                    ++cnt[open[ci][cj][d]];
                }
            }
            // cout << ci << ' ' << cj << ' ' << cnt[0] << ' ' << cnt[1] << endl;
            if(cnt[0] && cnt[1]){
                win[ci][cj] = true;
                // cout << ci << ' ' << cj << endl; 
                rep(d,4){
                    int ni = ci + di[d];
                    int nj = cj + dj[d];
                    if(inner(ni,nj) && !win[ni][nj]){
                        q.emplace(ni,nj);
                    }
                }
            }
        }
        bool ok = win[r][c];
        rep(d,4){
            int ni = r + di[d];
            int nj = c + dj[d];
            if(open[r][c][d] && (!inner(ni,nj) || win[ni][nj])) ok = true;
        }
        cout << (ok ? "Yes" : "No") << '\n';
    }
}