//??¶?????????????????????????????§MinMax???????????\??????????????????, ????????????????????¶????????????????????§,
//??????????????¢?´¢??????, ????????¶????????´??°????????????
//????????¢?????¶???, Alice??????????????§???????????¶???????¢??????????????????????????????¢?????????????????§, 1-indexed??§????£??????????

#include <iostream>
#include <queue>
#include <tuple>
#define rep(i, n) for (i = 0; i < n; i++)
using namespace std;

int h, w, r, c;
int horz[502][502];
int vert[502][502];
bool is_win[2][502][502];

bool input() {
	int i, j;
	
	cin >> h >> w >> r >> c; if (!h) return false;
	rep(i, h) {
		rep(j, w) cin >> horz[i + 1][j + 1];
		rep(j, w + 1) cin >> vert[i + 1][j + 1];
	}
	rep(j, w) cin >> horz[h + 1][j + 1];
	return true;
}

int dy[4] = {-1, 0, 1, 0};
int dx[4] = {0, 1, 0, -1};

bool is_range(int r, int c) { return (1 <= r && r <= h && 1 <= c && c <= w); }
typedef tuple<int, int, int> T;

void bfs() {
	int i, j;
	static queue<T> que;
	
	rep(i, h + 2) rep(j, w + 2) { is_win[0][i][j] = true;  }
	rep(i, h) rep(j, w) { is_win[0][i + 1][j + 1] = false; }
	rep(i, h + 2) rep(j, w + 2) { is_win[1][i][j] = is_win[0][i][j]; if (is_win[0][i][j]) { que.push(T(0, i, j)); que.push(T(1, i, j)); } }
	
	while (!que.empty()) {
		T now = que.front(); que.pop();
		int flip = get<0>(now);
		int y = get<1>(now);
		int x = get<2>(now);
		
		if (!is_win[!flip][y][x]) continue;		//??????????????¶?????????????????´??????, ????????????????§?????????¨?????????
		
		for (i = 0; i < 4; i++) {
			if (!is_range(y + dy[i], x + dx[i])) continue;
			
			int next_flip;
			if (i == 0) next_flip = horz[y][x];
			if (i == 1) next_flip = vert[y][x+1];
			if (i == 2) next_flip = horz[y+1][x];
			if (i == 3) next_flip = vert[y][x];
			
			if (is_win[next_flip][y + dy[i]][x + dx[i]]) continue;	//?????????
			is_win[next_flip][y + dy[i]][x + dx[i]] = true;
			que.push(T(next_flip, y + dy[i], x + dx[i]));
		}
	}
}

int main() {
	while (input()) {
		bfs();
		cout << ((is_win[0][r][c]) ? "Yes" : "No") << endl;
	}
	return 0;
}