/*
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
//#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<int,int,int> tp;
typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int n,m;
vvi G;
vi t;
vi used;
void f(int a){
	t.pb(a+1);
	rep(i,G[a].size())if(used[G[a][i]]==0){
		used[G[a][i]]=1;
		f(G[a][i]);
	}
}
int main(){
	cin>>n>>m;
	G=vvi(n);
	used=vi(n);
	rep(i,m){
		int a,b;cin>>a>>b;a--;b--;
		G[a].pb(b);
		G[b].pb(a);
	}
	used[0]=1;
	f(0);
	vi a=t;
	t=vi(0);
	f(0);
	cout<<t.size()+a.size()-1<<endl;
	rep(i,a.size()-1)cout<<a[a.size()-1-i]<<" ";
	rep(i,t.size())cout<<t[i]<<" \n"[i==t.size()-1];
}

*/
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<string> vs;
typedef vector<Def> vi;
typedef vector<vi> vvi;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int n,m,xx,yy;
vvi h,w;
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
int main(){
	while(cin>>n>>m>>xx>>yy,n){
		h=vvi(n,vi(m+1));
		w=vvi(n+1,vi(m));
		rep(i,n+1){
			rep(j,m)cin>>w[i][j];
			if(i!=n)rep(j,m+1)cin>>h[i][j];
		}
		vvi used(n+2,vi(m+2));
		queue<pii>que;
		rep(i,n+2)rep(j,m+2)if(i==0||j==0||i==n+1||j==m+1)used[i][j]=1;
		else if(i==1||j==1||i==n||j==m)que.push({i,j});
		while(!que.empty()){
			pii t=que.front();
			que.pop();
			if(used[t.first][t.second])continue;
			int e[2]={0};
			if(used[t.first+1][t.second])e[w[t.first][t.second-1]]=1;
			if(used[t.first-1][t.second])e[w[t.first-1][t.second-1]]=1;
			if(used[t.first][t.second+1])e[h[t.first-1][t.second]]=1;
			if(used[t.first][t.second-1])e[h[t.first-1][t.second-1]]=1;
			if(e[0]+e[1]==2){
				used[t.first][t.second]=1;
				rep(i,4){
					int x=t.first+dx[i];
					int y=t.second+dy[i];
					if(used[x][y]==0)que.push({x,y});
				}
			}
		}
		int e=used[xx][yy];
		if(!w[xx][yy-1])e=e||used[xx+1][yy];
		if(!w[xx-1][yy-1])e=e||used[xx-1][yy];
		if(!h[xx-1][yy])e=e||used[xx][yy+1];
		if(!h[xx-1][yy-1])e=e||used[xx][yy-1];
		if(e)cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
}


Measured memory_bytes: 5860