#include <bits/stdc++.h>
using namespace std;
using graph = vector<vector<int>>;

vector<int> retrograde(const graph& g) { // (0, 1, 2) = (lose, win, draw)
	int n = g.size();
	graph rg(n);
	vector<int> cnt(n), res(n, 2);
	queue<int> q;
	for (int i = 0; i < n; i++) {
		for (int to : g[i]) rg[to].push_back(i);
		cnt[i] = g[i].size();
		if (!cnt[i]) res[i] = 0, q.push(i);
	}
	while (!q.empty()) {
		int v = q.front(); q.pop();
		if (res[v]) {
			for (int to : rg[v]) if (res[to] != 1) {
				--cnt[to];
				if (cnt[to]) continue;
				res[to] = 0;
				q.push(to);
			}
			continue;
		}
		for (int to : rg[v]) if (res[to] != 1) res[to] = 1, q.push(to);
	}
	return res;
}

int main()
{
	ios::sync_with_stdio(false), cin.tie(0);
	int H, W, R, C;
	while (cin >> H >> W >> R >> C, H | W | R | C) {
		int S = (H + 2) * (W + 2);
		graph G(S * 3);
		for (int i = 1; i <= H; i++) {
			for (int j = 1; j <= W; j++) {
				G[i * (W + 2) + j + S * 2].push_back(i * (W + 2) + j);
				G[i * (W + 2) + j + S * 2].push_back(i * (W + 2) + j + S);
			}
		}
		for (int t = 0; t <= H * 2; t++) {
			int i = (t + 1) >> 1;
			int s;
			if (t % 2 == 0) {
				for (int j = 1; j <= W; j++) {
					cin >> s;
					if (0 < i) G[i * (W + 2) + j + S * s].push_back((i + 1) * (W + 2) + j + S * 2);
					if (i < H) G[(i + 1) * (W + 2) + j + S * s].push_back(i * (W + 2) + j + S * 2);
				}
			}
			else {
				for (int j = 0; j <= W; j++) {
					cin >> s;
					if (0 < j) G[i * (W + 2) + j + S * s].push_back(i * (W + 2) + (j + 1) + S * 2);
					if (j < W) G[i * (W + 2) + (j + 1) + S * s].push_back(i * (W + 2) + j + S * 2);
				}
			}
		}
		cout << (retrograde(G)[R * (W + 2) + C] == 1 ? "Yes" : "No") << endl;
	}
	return 0;
}

