#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-12;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/

const int dx[] = { -1, 0, 1, 0 }, dy[] = { 0, -1, 0, 1 };
//const int dx[] = { -1, -1, -1, 0, 0, 1, 1, 1 }, dy[] = { 0, -1, 1, -1, 1, 0, -1, 1 };
bool valid(int x, int y, int h, int w) { return (x >= 0 && y >= 0 && x < h&&y < w); }
int place(int x, int y, int w) { return w*x + y; }


typedef int Weight;
struct Edge
{
	int from, to; Weight cost;
	bool operator < (const Edge& e) const { return cost < e.cost; }
	bool operator > (const Edge& e) const { return cost > e.cost; }
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
typedef vector<Weight> Array;
typedef vector<Array> Matrix;
void add_edge(Graph &g, int from, int to, Weight cost)
{
	g[from].push_back(Edge{ from, to, cost });
}

int h, w, r, c;
int main()
{
	cin.sync_with_stdio(false); cout << fixed << setprecision(10);
	while (cin >> h >> w >> r >> c, h)
	{
		r--; c--;
		int st = place(r, c, w), go = place(h - 1, w - 1, w) + 1;
		Graph g(h*w + 1);
		REP(i, h)REP(j, w)
		{
			int tmp = place(i, j, w);
			REP(k, 4)
			{
				int nx = i + dx[k], ny = j + dy[k];
				if (!valid(nx, ny, h, w)) add_edge(g, tmp, go, 1);
				else add_edge(g, tmp, place(nx, ny, w), 1);
			}
		}
		REP(i, 2 * h + 1)
		{
			if (i % 2 == 0)
			{
				REP(j, w)
				{
					int a; cin >> a;
					if (a == 0) continue;
					int x = i / 2;
					if (i != 0) g[place(x - 1, j, w)][2].cost = 0;
					if (i != 2 * h) g[place(x, j, w)][0].cost = 0;
				}
			}
			else
			{
				REP(j, w + 1)
				{
					int a; cin >> a;
					if (a == 0) continue;
					int x = i / 2;
					if (j != 0) g[place(x, j - 1, w)][3].cost = 0;
					if (j != w) g[place(x, j, w)][1].cost = 0;
				}
			}
		}
		bool f = false;
		REP(i, 4)
		{
			if (g[st][i].to == go && g[st][i].cost == 1)
			{
				f = true;
				cout << "Yes" << endl;
				break;
			}
		}
		if (f) continue;
		REP(i, h)REP(j, w)
		{
			int tmp = place(i, j, w);
			for (auto e : g[tmp])
			{
				if (e.to != go) continue;
				add_edge(g, go, tmp, e.cost);
			}
		}
		vi win(h*w + 1);
		win[go] = 1;
		queue<pii> que;
		que.emplace(h, 0);
		while (!que.empty())
		{
			int x = que.front().first, y = que.front().second;
			que.pop();
			int tmp = place(x, y, w);
			for (auto e : g[tmp])
			{
				int nx = e.to;
				if (win[nx]) continue;
				bool f1 = false, f2 = false;
				for (auto f : g[nx])
				{
					if (win[f.to] && f.cost == 0) f1 = true;
					if (win[f.to] && f.cost == 1) f2 = true;
				}
				if (f1 && f2)
				{
					win[nx] = 1;
					que.emplace(nx / w, nx % w);
				}
			}
		}
		//cout << h << " " << w << endl;
		if (win[st]) cout << "Yes" << endl;
		else cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 25320