#include <algorithm>
#include <array>
#include <cassert>
#include <climits>
#include <complex>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#include <cassert>

using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()

#define vi vector<int>
#define vvi vector<vector<int>>

int d4x[] = {0, 1, 0, -1};
int d4y[] = {-1, 0, 1, 0};

int main() {
    while(true) {
        int h, w, r, c; cin >> h >> w >> r >> c;
        if (h == 0 and w == 0) break;
        vvi lr(h, vi(w+1, 0));
        vvi tb(h+1, vi(w, 0));
        REP(i, 2 * h + 1) {
            if (i % 2 == 0) {
                REP(k, w) {
                    cin >> tb[i/2][k];
                }
            } else {
                REP(k, w+1) {
                    cin >> lr[i/2][k];
                }
            }
        }
        deque<tuple<int,int>> que;
        REP(y, h) {
            que.push_back(make_tuple(y, 0));
            que.push_back(make_tuple(y, w - 1));
        }
        REP(x, w) {
            que.push_back(make_tuple(0, x));
            que.push_back(make_tuple(h - 1, x));
        }

        vvi esc(h + 2, vi(w + 2, false));
        REP(y, h + 2) {
            esc[y][0] = esc[y][w+1] = true;
        }
        REP(x, w + 2) {
            esc[0][x] = esc[h+1][x] = true;
        }
        auto wald = [&] (int y, int x, int d) {
            switch(d) {
                case 2: return tb[y + 1][x];
                case 0: return tb[y][x];
                case 1: return lr[y][x + 1];
                case 3: return lr[y][x];
            }
            assert(false);
        };

        while(not que.empty()) {
            int y, x; tie(y, x) = que.front(); que.pop_front();
            int esT = false, esF = false;
            REP(d, 4) {
                int dy = d4y[d];
                int dx = d4x[d];
                if (esc[y + 1][x + 1]) continue;
                if (esc[y + dy + 1][x + dx + 1]) {
                    if(wald(y, x, d)){
                        esT = true;
                    } else {
                        esF = true;
                    }
                }
            }
            if (esT and esF) {
                esc[y + 1][x + 1] = true;
                REP(d, 4) {
                    int ny = y + d4y[d];
                    int nx = x + d4x[d];
                    if(ny >= 0 and ny < h and nx >= 0 and nx < w and
                        (not esc[ny + 1][nx + 1])){
                        que.push_back(make_tuple(ny, nx));
                    }
                }
            }
        }
        /*
        REP(y, h) {
            REP(x, w) {
                cout << ((esc[y + 1][x + 1]) ? "#" : ".");
            }
            cout << endl;
        }
        */
        bool escp = false;
        REP(d, 4) {
            int dy = d4y[d];
            int dx = d4x[d];
            int y = r + dy - 1;
            int x = c + dx - 1;
            if (not wald(r - 1, c - 1, d)) {
                escp = escp || esc[y + 1][x + 1];
            }
        }
        if (escp) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
}
/*
4 4 1 1

 1 0 0 0
1 0 0 0 0
 0 0 0 0
1 0 0 0 0
 0 0 0 0
0 1 0 1 1
 0 1 0 0
0 0 0 0 0
 0 1 1 1
*/


Measured memory_bytes: 5764