
import scala.annotation.tailrec
import scala.collection.mutable

object Main extends App {

  import scala.io.StdIn._
  solve
  @tailrec def solve:Unit = {
    val Array(h, w, r, c) = readLine.trim.split(' ').map(_.toInt)
    if (h == 0 && w == 0 && r == 0 && c == 0) Unit
    else {
      val board = new Board(h, w)
      for (i ← 0 until (2 * h + 1)) {
        val op = readLine.trim.split(' ').map(_.toInt == 1)
        if (i % 2 == 0) {
          for (pos ← op.indices) {
            if (op(pos)) board.setHorizontalWall(pos + 1, i / 2 + 1)
          }
        } else {
          for (pos ← op.indices) {
            if (op(pos)) board.setVerticalWall(i / 2 + 1, pos + 1)
          }
        }
      }
      println(
        if (canEscape(board, Coordinate(c, r))) "Yes" else "No"
      )
      solve
    }
  }
  def canEscape(board: Board, init: Coordinate): Boolean = {
    import Main.Board._
    val height = board.height
    val width = board.width
    var canEscape = init match{
      case Main.Coordinate(x, y) ⇒ {
        (x == 1 && board(y, x).left == None) || (x == width && board(y, x).right == None) || (y == 1 && board(y, x).up == None) || (y == height && board(y, x).down == None)
      }
    }
    val flags: Array[Array[Int]] = Array.tabulate(height + 2){ _ ⇒ Array.tabulate(width + 2){ _ ⇒ 0}}
    for (w ← 1 to width) {
      flags(1)(w) |= (board(1, w).up match{
        case Wall ⇒ 1
        case None ⇒ 2
      })
      flags(height)(w) |= (board(height, w).down match{
        case Wall ⇒ 1
        case None ⇒ 2
      })
    }
    for (h ← 1 to height){
      flags(h)(1) |= (board(h, 1).left match{
        case Wall ⇒ 1
        case None ⇒ 2
      })
      flags(h)(width) |= (board(h, width).right match{
        case Wall ⇒ 1
        case None ⇒ 2
      })
    }
    val cells = mutable.Queue[Coordinate]((1 to height).flatMap(y ⇒ (1 to width).filter(x ⇒ flags(y)(x) == 3).map(x ⇒ Coordinate(x, y))):_*)
    while (cells.nonEmpty && !canEscape) {
      val top = cells.dequeue()
      for ((state, next) ← board(top.y, top.x).neighbors){
        if (flags(next.y)(next.x) != 3) {
          flags(next.y)(next.x) |= (state match {
            case Wall ⇒ 1
            case None ⇒ 2
          })
          if (flags(next.y)(next.x) == 3) {
            if (next == init)
              canEscape = true
            else
              cells.enqueue(next)
          }
        }
      }
    }
    canEscape
  }
  implicit class Scoped[V](val value: V){
    def let[A](func: V ⇒ A): A = func(value)
    def also(func: V ⇒ Unit): V = {
      func(value)
      value
    }
  }
  case class Coordinate(x: Int, y: Int){
    def +(that: Coordinate): Coordinate = Coordinate(this.x + that.x, this.y + that.y)
  }
  object Board{
    sealed trait Separation
    object Wall extends Separation
    object None extends Separation
    case class Cell(coordinate: Coordinate, var left: Separation, var right: Separation, var up: Separation, var down: Separation) {
      def neighbors: Iterable[(Separation, Coordinate)] = List[(Separation, Coordinate)](left → (Coordinate(-1, 0) + coordinate), right → (Coordinate(1, 0) + coordinate), up → (Coordinate(0, -1) + coordinate), down → (Coordinate(0, 1) + coordinate))
    }
  }
  class Board(val height: Int, val width: Int) {
    import Board._
    private val cells: Array[Array[Board.Cell]] = Array.tabulate(height + 2){h ⇒ Array.tabulate(width + 2){w ⇒ Board.Cell(Coordinate(w, h), None, None, None, None)}}
    def setVerticalWall(row: Int, position: Int): Unit = {
      cells(row)(position).left = Wall
      cells(row)(position - 1).right = Wall
    }
    def setHorizontalWall(column: Int, position: Int): Unit = {
      cells(position)(column).up = Wall
      cells(position - 1)(column).down = Wall
    }
    def apply(y: Int, x: Int): Cell = {
      cells(y)(x)
    }
  }
}
