#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Solve {
public:
    int H, W, R, C;
    vector<vector<vector<vector<bool>>>> movable0; //移動できるかどうか
    vector<vector<vector<vector<bool>>>> movable1;
    vector<vector<bool>> field0; //勝ってるかどうか
    vector<vector<bool>> field1;

    void input() {

    }

    bool canmove0(int h, int w, int dh, int dw) {
        if (h + dh < 0) return false;
        if (h + dh > H + 1) return false;
        if (w + dw < 0) return false;
        if (w + dw > W + 1) return false;
        return movable0[h][w][dh + 1][dw + 1];
    }

    bool canmove1(int h, int w, int dh, int dw) {
        if (h + dh < 0) return false;
        if (h + dh > H + 1) return false;
        if (w + dw < 0) return false;
        if (w + dw > W + 1) return false;
        return movable1[h][w][dh + 1][dw + 1];
    }

    void printWL(vector<vector<bool>> &v) {
        for (auto e : v) {
            for (auto ee : e) {
                if (ee) cout << 'W';
                else cout << 'L';
            }
            cout << endl;
        }
    }

    bool solve() {
        input();
        cin >> H >> W >> R >> C;
        if (H == 0) return false;
        movable0.resize(H + 2, vector<vector<vector<bool>>>(W + 2, vector<vector<bool>>(3, vector<bool>(3,
                                                                                                        true)))); // 0が-1, 1が0, 2が1
        movable1.resize(H + 2, vector<vector<vector<bool>>>(W + 2, vector<vector<bool>>(3, vector<bool>(3, true))));
        field0.resize(H + 2, vector<bool>(W + 2, false));
        field1.resize(H + 2, vector<bool>(W + 2, false));

        for (int i = 0; i < 2 * H + 1; ++i) {
            if (i == 1) {
                int ei = 1333;
            }
            if (i % 2 == 0) {
                //horizon
                vector<int> h(W + 1);
                for (int j = 1; j < W + 1; ++j) {
                    cin >> h[j];
                    int fromh = i / 2;
                    int toh = i / 2 + 1;
                    if (h[j] == 0) {
                        movable0[fromh][j][2][1] = false;
                        movable0[toh][j][0][1] = false;
                    } else {
                        movable1[fromh][j][2][1] = false;
                        movable1[toh][j][0][1] = false;
                    }
                }
            } else {
                vector<int> v(W + 2);
                for (int j = 1; j < W + 2; ++j) {
                    cin >> v[j];
                    int fromw = j - 1;
                    int tow = j;
                    int h = i / 2 + 1;
                    if (v[j] == 0) {
                        movable0[h][fromw][1][2] = false;
                        movable0[h][tow][1][0] = false;
                    } else {
                        movable1[h][fromw][1][2] = false;
                        movable1[h][tow][1][0] = false;
                    }
                }
            }
        }

        queue<pair<int, int>> que;
        vector<vector<bool>> used(H + 2, vector<bool>(W + 2, false));

        for (int i = 0; i < H + 2; ++i) {
            for (int j = 0; j < W + 2; ++j) {
                if (i == 0 || j == 0 || i == H + 1 || j == W + 1) {
                    field0[i][j] = true;
                    field1[i][j] = true;
                    que.emplace(i, j);
                    used[i][j] = true;
                }
            }
        }


        while (!que.empty()) {
            auto top = que.front();
            que.pop();
            int h = top.first;
            int w = top.second;

            for (int dh = -1; dh <= 1; ++dh) {
                for (int dw = -1; dw <= 1; ++dw) {
                    if (dh * dw != 0 || dh + dw == 0) {
                        continue;
                    }
                    int nh = h + dh;
                    int nw = w + dw;
                    if (nh == 1 && nw == 3) {
                        int tapi = 13;
                    }
                    if (canmove0(h, w, dh, dw)) {
                        field0[nh][nw] = true;
                    }
                    if (canmove1(h, w, dh, dw)) {
                        field1[nh][nw] = true;
                    }
                    if (nh >= 0 && nh <= H + 1 && nw >= 0 && nw <= W + 1 && field0[nh][nw] && field1[nh][nw] &&
                        !used[nh][nw]) {
                        used[nh][nw] = true;
                        que.emplace(nh, nw);
                    }
                }
            }

//            cout << "field0" << endl;
//            printWL(field0);
//            cout << "field1" << endl;
//            printWL(field1);
//            cout << "---------" << endl;
        }

        if (field1[R][C]) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }


        return true;
    }
};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

//    Solve().solve();
    while (Solve().solve());


    return 0;
}



Measured memory_bytes: 125496