#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) for (long long i = 0, max_i = (n); i < max_i; i++)
#define REPI(i, a, b) for (long long i = (a), max_i = (b); i < max_i; i++)
#define ALL(obj) begin(obj), end(obj)
#define RALL(obj) rbegin(obj), rend(obj)
#define fi first
#define se second
using ii = pair<int, int>;
vector<ii> dirs = {
  {1, 0}, {0, 1}, {-1, 0}, {0, -1},  // 4方向
  {1, 1}, {-1, 1}, {-1, -1}, {1, -1},  // 斜め
  {0, 0},  // 自身
};
template <class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } return false; }
template <class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } return false; }
template <class T, class S> vector<T> make_vec(size_t n, S x) { return vector<T>(n, x); }
template <class T, class... Ts> auto make_vec(size_t n, Ts... ts) { return vector<decltype(make_vec<T>(ts...))>(n, make_vec<T>(ts...)); }

// debug
template <class T> ostream& operator<<(ostream& s, vector<T>& d) { REP (i, d.size()) s << d[i] << (i == d.size() - 1 ? "" : " "); return s; }
template <class T> ostream& operator<<(ostream& s, vector<vector<T>>& d) { REP (i, d.size()) s << d[i] << (i == d.size() - 1 ? "" : "\n"); return s; }
template <class T, class S> ostream& operator<<(ostream& s, pair<T, S>& p) { s << "{" << p.first << ", " << p.second << "}"; return s; }
template <class T, class S> ostream& operator<<(ostream& s, map<T, S> m) { for (auto it = m.begin(); it != m.end(); it++) { s << *it << (next(it) == m.end() ? "" : "\n"); } return s; }
#ifdef _MY_DEBUG
  #define dump(...) cerr << "/* " << #__VA_ARGS__ << " :[" << __LINE__ << ":" << __FUNCTION__ << "]" << endl, dump_func(__VA_ARGS__), cerr << "*/\n\n";
#else
  #define dump(...)
  #define endl "\n"
#endif
void dump_func() { cerr << endl; }
template <class Head, class... Tail> void dump_func(Head&& h, Tail&&... t) { cerr << h << (sizeof...(Tail) == 0 ? "" : ", "), dump_func(forward<Tail>(t)...); }

struct Fast { Fast() { cin.tie(0); ios::sync_with_stdio(false); } } fast;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
constexpr int MOD = 1000000007;
// *************** TEMPLATE END *************** 

void solve() {
  int H, W, R, C; cin >> H >> W >> R >> C;
  if (H == 0) exit(0);
  vector<vector<int>> hor(H + 1 + 2, vector<int>(W + 2));
  vector<vector<int>> ver(H + 2, vector<int>(W + 1 + 2));
  REP (i, 2 * H + 1) {
    if (i % 2) {
      REP (j, W + 1) cin >> ver[i / 2 + 1][j + 1];
    } else {
      REP (j, W) cin >> hor[i / 2 + 1][j + 1];
    }
  }
  vector<vector<int>> dp(H + 2, vector<int>(W + 2));
  REP (i, H + 2) dp[i][0] = dp[i][W + 1] = 1;
  REP (j, W + 2) dp[0][j] = dp[H + 1][j] = 1;
  queue<ii> q;
  REPI (i, 1, H + 1) {
    REPI (j, 1, W + 1) {
      if (i == 1 || i == H || j == 1 || j == W) q.push({i, j});
    }
  }
  while (!q.empty()) {
    ii p = q.front(); q.pop();
    int i = p.fi, j = p.se;
    if (dp[i][j]) continue;
    vector<int> ok(2);
    ok[ver[i][j]] |= dp[i][j - 1];
    ok[ver[i][j + 1]] |= dp[i][j + 1];
    ok[hor[i][j]] |= dp[i - 1][j];
    ok[hor[i + 1][j]] |= dp[i + 1][j];
    if (ok[0] && ok[1]) {
      dp[i][j] = 1;
      q.push({i - 1, j});
      q.push({i + 1, j});
      q.push({i, j - 1});
      q.push({i, j + 1});
    }
  }
  bool ok = false;
  ok |= !hor[R][C] & dp[R - 1][C];
  ok |= !hor[R + 1][C] & dp[R + 1][C];
  ok |= !ver[R][C] & dp[R][C - 1];
  ok |= !ver[R][C + 1] & dp[R][C + 1];
  cout << (ok ? "Yes" : "No") << endl;
}
signed main() {
  while (1) solve();
}



Measured memory_bytes: 8976