import std.stdio;
import std.algorithm;
import std.string;
import std.container;
import std.typecons;

void log(A...)(A arg) {
    stderr.writeln(arg);
}

void main() {
    while (true) {
        int H, W, R, C;
        readf("%d %d %d %d\n", &H, &W, &R, &C);
        if (H == 0 && W == 0 && R == 0 && C == 0) break;
        R--; C--;
        auto F = new string[H * 2 + 1];
        foreach (ref L; F) {
            L = readln.chomp;
            if (L.length == W * 2) L ~= " ";
        }

        auto state = new int[][][](H, W, 2);
        foreach (ref a; state) foreach (ref b; a) b[] = -1;
        
        alias P = Tuple!(int, "y", int, "x");

        const dy = [0, 1, 0, -1];
        const dx = [1, 0, -1, 0];
        int y = 0, x = 0, dir = 0;
        DList!P Q;
        auto inQ = new bool[][](H, W);
        do {
            int py = y * 2 + 1;
            int px = x * 2 + 1;
            foreach (i; 0 .. 2) {
                foreach (k; 0 .. 4) {
                    int by = py + dy[k];
                    int bx = px + dx[k];
                    if (! (by == 0 || bx == 0 || by == H * 2 || bx == W * 2) ) continue;
                    if ( (F[by][bx] == '0' && i == 0) || (F[by][bx] == '1' && i == 1) ) {
                        foreach (l; 0 .. 4) {
                            int ny = y + dy[l];
                            int nx = x + dx[l];
                            if (ny < 0 || ny >= H || nx < 0 || nx >= W) continue;
                            if (inQ[ny][nx]) continue;
                            Q.insert(P(ny, nx));
                            inQ[ny][nx] = true;
                        }
                        state[y][x][i] = 1;
                    }
                }
            }
            int ny = y + dy[dir];
            int nx = x + dx[dir];
            while (ny < 0 || ny >= H || nx < 0 || nx >= W) {
                dir++;
                if (dir == 4) {
                    assert(H == 1 && W == 1);
                    ny = 0; nx = 0; break;
                }
                ny = y + dy[dir];
                nx = x + dx[dir];
            }
            y = ny;
            x = nx;
        } while (!(y == 0 && x == 0));

        while (!Q.empty) {
            P c = Q.front; Q.removeFront;
            inQ[c.y][c.x] = false;
            foreach (k; 0 .. 4) {
                int ny = c.y + dy[k];
                int nx = c.x + dx[k];
                int by = c.y * 2 + 1 + dy[k];
                int bx = c.x * 2 + 1 + dx[k];
                foreach (i; 0 .. 2) {
                    if (state[c.y][c.x][i] == 1) continue;
                    if ( (F[by][bx] == '0' && i == 0) || (F[by][bx] == '1' && i == 1) ) {
                        if ( (ny < 0 || ny >= H || nx < 0 || nx >= W) || (state[ny][nx][0] == 1 && state[ny][nx][1] == 1) ) {
                            state[c.y][c.x][i] = 1;
                            foreach (l; 0 .. 4) {
                                int nny = c.y + dy[l];
                                int nnx = c.x + dx[l];
                                if (nny < 0 || nny >= H || nnx < 0 || nnx >= W) continue;
                                if (inQ[nny][nnx]) continue;
                                Q.insert(P(nny, nnx));
                                inQ[nny][nnx] = true;
                            }
                        }
                    }
                }
            }
        }
        writeln(state[R][C][0] == 1 ? "Yes" : "No");

    }
}