#include<bits/stdc++.h>
using namespace std;

#define int long long
constexpr int INF = 1e18;

int solve(int H, int W, int R, int C){
  int dx[4] = {0, 1, 0, -1};
  int dy[4] = {-1, 0, 1, 0};
  vector<vector<vector<int>>> field(H, vector<vector<int>>(W, vector<int>(4)));
  vector<vector<vector<int>>> yes(H, vector<vector<int>>(W, vector<int>(2)));
  queue<pair<int,int>> Q;


  for(int i = 0; i < H * 2 + 1; i++){
    if(i%2) {
      for(int j = 0; j < W + 1; j++){
        int Vert;

        cin>>Vert;

        if(j-1 >= 0) field[i/2][j-1][1] = Vert;
        if(j < W) field[i/2][j][3] = Vert;
      }


    } else {
      for(int j = 0; j < W; j++){
        int Horz;

        cin>>Horz;

        if(i/2 - 1>= 0) field[i/2 - 1][j][2] = Horz;
        if(i/2 < H) field[i/2][j][0] = Horz;

      }
    }
  }


  //  cout<<"<><><><> "<<endl;

  for(int y = 0; y < H; y++){
    for(int x = 0; x < W; x++){
      if(!(y == 0 || y == H-1 || x == 0 || x == W-1)) continue;

      int con0 = 0, con1 = 0;
      bool flag0 = false, flag1 = false;

      for(int j = 0; j < 4; j++){
        int ny = y + dy[j], nx = x + dx[j];

        if(field[y][x][j]) con1++;
        else con0++;
        // if(field[y][x][j]) cout<<"*"<<endl;
        //  else cout<<"?"<<endl;
        if(ny >= H || ny < 0 || nx >= W || nx < 0) {
          if(field[y][x][j]) flag1 = true;
          else flag0 = true;
          continue;
        }
        if(yes[ny][nx][1] && yes[ny][nx][0]) {
          if(field[y][x][j]) flag1 = true;
          else flag0 = true;
        }
      }

      if(con0 == 0) yes[y][x][1] = true;
      if(con1 == 0) yes[y][x][0] = true;
      if(flag0) yes[y][x][0] = true;
      if(flag1) yes[y][x][1] = true;

      if(yes[y][x][0] && yes[y][x][1]) {
        // cout<<con0<<" "<<con1<<endl;
        // cout<<flag0<<" "<<flag1<<endl;
        // cout<<"<><> y = "<<y<<" x = "<<x<<endl;
        for(int j = 0; j < 4; j++){
          int ny = y + dy[j], nx = x + dx[j];
          if(ny >= H || ny < 0 || nx >= W || nx < 0) continue;
          Q.push({ny,nx});
        }

      }
    }
  }

  ///  cout<<"<><><><> "<<endl;

  while(Q.size()){
    pair<int,int> p = Q.front(); Q.pop();
    int y = p.first, x = p.second;

    //  cout<<"y = "<<y<<" x = "<<x<<endl;

    if(yes[y][x][0] && yes[y][x][1]) continue;

    int con0 = 0, con1 = 0;
    bool flag0 = false, flag1 = false;

    for(int j = 0; j < 4; j++){
      int ny = y + dy[j], nx = x + dx[j];

      if(field[y][x][j]) con1++;
      else con0++;

      if(ny >= H || ny < 0 || nx >= W || nx < 0) {
        if(field[y][x][j]) flag1 = true;
        else flag0 = true;
        continue;
      }
      if(yes[ny][nx][1] && yes[ny][nx][0]) {
        if(field[y][x][j]) flag1 = true;
        else flag0 = true;
      }
    }

    if(con0 == 0) yes[y][x][1] = true;
    if(con1 == 0) yes[y][x][0] = true;
    if(flag0) yes[y][x][0] = true;
    if(flag1) yes[y][x][1] = true;


    if(yes[y][x][0] && yes[y][x][1]) {

      for(int j = 0; j < 4; j++){
        int ny = y + dy[j], nx = x + dx[j];
        if(ny >= H || ny < 0 || nx >= W || nx < 0) continue;
        Q.push({ny,nx});
      }
    }
  }


  return yes[R-1][C-1][0];
}

signed main(){

  while(true){
    int H, W, R, C;

    cin>>H>>W>>R>>C;

    if(!H && !W && !R && !C) break;

    cout<<(solve(H, W, R, C)?"Yes":"No")<<endl;
  }
  return 0;
}




Measured memory_bytes: 34408