#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <cstdio>
		//cin.sync_with_stdio(false);
		//streambuf
		using namespace std;
	typedef long long ll;
	typedef pair<int, int> pii;
	using pll = pair<ll, ll>;
	typedef pair<double, double> pdd;
	using vi = vector<int>;
	using vll = vector<ll>;
	using vpii = vector<pii>;
	using ti3 = tuple<int, int, int>;
	template<class T, class T2> using umap = unordered_map<T, T2>;
	template<class T> using uset = unordered_set<T>;
#define ALL(a) a.begin(),a.end()
#define rep(i,a) for(int i=0;i<a;i++)
#define rep1(i,a) for(int i=1;i<=a;i++)
#pragma warning(disable:4996)
#define INF 1000000000000000.0

	int res[502][502][3];
	bool xwall[501][501];
	bool ywall[501][501];
	bool used[502][502];
	typedef pair<int, int> P;

	int main() {
		while (1) {
			int h, w, x, y;
			int i, j;
			scanf("%d %d %d %d", &h, &w, &x, &y);
			if (h == 0)break;
			for (int k = 0; k <= 2 * h; k++) {
				if (k % 2 == 0) {
					i = k / 2;
					for (j = 1; j <= w; j++) {
						int t;
						scanf("%d", &t);
						ywall[i][j] = (t == 1);
					}
				}
				else {
					i = (k + 1) / 2;
					for (j = 0; j <= w; j++) {
						int t;
						scanf("%d", &t);
						xwall[i][j] = (t == 1);
					}
				}
			}
			for (i = 0; i <= h+1; i++)for (j = 0; j <= w+1; j++)used[i][j] = false;
			for (i = 0; i <= h + 1; i++) {
				for (j = 0; j <= w + 1; j++) {
					res[i][j][0] = 0;
					res[i][j][1] = 0;
					res[i][j][2] = 0;
					if (i == 0 || i == h + 1 || j == 0 || j == w + 1) {
						res[i][j][0] = 1;
						res[i][j][1] = 1;
						res[i][j][2] = 1;
						used[i][j] = true;
					}
				}
			}
			queue<P> que;
			for (i = 1; i <= h; i++) {
				que.push(P(i, 0));
				que.push(P(i, w + 1));
			}
			for (j = 1; j <= w; j++) {
				que.push(P(0, j));
				que.push(P(h+1, j));
			}
			while (!que.empty()) {
				P p = que.front();
				que.pop();
				i = p.first;
				j = p.second;
				if (j - 1 >= 0) {
					if (xwall[i][j - 1])res[i][j-1][1] = 1;
					else res[i][j - 1][0] = 1;
					if (res[i][j-1][0] == 1 && res[i][j-1][1] == 1 && !used[i][j-1]) {
						used[i][j-1] = true;
						que.push(P(i, j-1));
					}
				}
				if (j + 1 <= w + 1) {
					if (xwall[i][j])res[i][j + 1][1] = 1;
					else res[i][j + 1][0] = 1;
					if (res[i][j+1][0] == 1 && res[i][j+1][1] == 1 && !used[i][j+1]) {
						used[i][j+1] = true;
						que.push(P(i, j+1));
					}
				}
				if (i - 1 >= 0) {
					if (ywall[i - 1][j])res[i - 1][j][1] = 1;
					else res[i - 1][j][0] = 1;
					if (res[i-1][j][0] == 1 && res[i-1][j][1] == 1 && !used[i-1][j]) {
						used[i-1][j] = true;
						que.push(P(i-1, j));
					}
				}
				if (i + 1 <= h + 1) {
					if (ywall[i][j])res[i + 1][j][1] = 1;
					else res[i + 1][j][0] = 1;
					if (res[i+1][j][0] == 1 && res[i+1][j][1] == 1 && !used[i+1][j]) {
						used[i+1][j] = true;
						que.push(P(i+1, j));
					}
				}
			}
			printf("%s\n", res[x][y][0] == 1 ? "Yes" : "No");
		}
		return 0;
	}

Measured memory_bytes: 6916