// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;

int H, W, R, C;

// URDL
int wall[510][510][4], rec[510][510][2];
signed main() {
    while(cin >> H >> W >> R >> C, H || W || R || C) {
        R--; C--;
        for(int i=0; i<2*H+1; i++) {
            if(i % 2 == 0) {
                for(int j=0; j<W; j++) {
                    int v; cin >> v;
                    int r = i / 2, c = j;
                    wall[r][c][0] = v;
                    if(r > 0) wall[r-1][c][2] = v;
                }
            }
            else {
                for(int j=0; j<W+1; j++) {
                    int v; cin >> v;
                    int r = i / 2, c = j;
                    if(j < W) wall[r][c][3] = v;
                    if(c > 0) wall[r][c-1][1] = v;
                }
            }
        }

        /*
        string pat = "URDL";
        for(int i=0; i<H; i++) {
            for(int j=0; j<W; j++) {
                for(int k=0; k<4; k++) {
                    if(wall[i][j][k]) {
                        fprintf(stderr, "coor = (%lld, %lld), dir = %c\n", i, j, pat[k]);
                    }
                }
            }
        }
        */

        // position (x, y), flip flag
        // 1: alice, 0: bob, -1: ?
        queue< tuple<int, int, int> > que;
        fill(rec[0][0], rec[H][0], -1);
        for(int i=0; i<H; i++) {
            for(int j=0; j<W; j++) {
                int c1 = 0, c2 = 0;
                for(int k=0; k<4; k++) {
                    int nx = i + dx[k], ny = j + dy[k];
                    if(nx < 0 or nx >= H or ny < 0 or ny >= W) {
                        if(wall[i][j][k] == 0) c1++;
                        if(wall[i][j][k] == 1) c2++;
                    }
                }

                // 勝利確定状態
                if(c1 > 0) rec[i][j][0] = 1;
                if(c2 > 0) rec[i][j][1] = 1;

                if(c1 > 0 and c2 > 0) {
                    que.emplace(i, j, 0);
                    que.emplace(i, j, 1);
                }
            }
        }

        while(que.size()) {
            int x, y, f; tie(x, y, f) = que.front(); que.pop();
            for(int k=0; k<4; k++) {
                int nx = x + dx[k], ny = y + dy[k];
                if(nx < 0 or nx >= H or ny < 0 or ny >= W) continue;
                for(int nf=0; nf<2; nf++) {
                    if(wall[x][y][k] == nf and rec[nx][ny][nf] < 0) {
                        rec[nx][ny][nf] = 1;
                        if(rec[nx][ny][!nf] == 1) {
                            que.emplace(nx, ny, 0);
                            que.emplace(nx, ny, 1);
                        }
                    }
                }
            }
        }

        if(rec[R][C][0] == 1) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}



Measured memory_bytes: 15072