mport scala.annotation.tailrec
import scala.collection.mutable
import scala.io.StdIn._
object Main extends App {

  val Array(h, w, n) = readLine.trim.split(' ').map(_.toInt)
  val Array(sy, sx) = readLine.trim.split(' ').map(_.toInt)
  val s = readLine.trim
  val t = readLine.trim
  var left = 1
  var right = h
  println(if (canDrop(s, t)) "YES" else "NO")
  def canDrop(s: String, t: String): Boolean = {
    @tailrec def canDropRow(s: List[Char], t: List[Char], safeLeft: Int, safeRight: Int): Boolean = {
      if (safeLeft > safeRight) return true
      val (newLeft, newRight, tx) = t match {
        case 'R'::ts ⇒ (math.max(1, safeLeft - 1), safeRight, ts)
        case 'L'::ts ⇒ (safeLeft, math.min(safeRight + 1, w), ts)
        case _::ts ⇒ (safeLeft, safeRight, ts)
        case Nil ⇒ return sx < safeLeft || safeRight < sx
      }
      s match {
        case 'R'::ss ⇒ canDropRow(ss, tx, newLeft, newRight - 1)
        case 'L'::ss ⇒ canDropRow(ss, tx, newLeft + 1, newRight)
        case _::ss ⇒ canDropRow(ss, tx, newLeft, newRight)
        case Nil ⇒ ???
      }
    }
    @tailrec def canDropColumn(s: List[Char], t: List[Char], safeUp: Int, safeBottom: Int): Boolean = {
      if (safeUp > safeBottom) return true
      val (newUp, newBottom, tx) = t match {
        case 'D'::ts ⇒ (math.max(1, safeUp - 1), safeBottom, ts)
        case 'U'::ts ⇒ (safeUp, math.min(safeBottom + 1, h), ts)
        case _::ts ⇒ (safeUp, safeBottom, ts)
        case Nil ⇒ return sy < safeUp || safeBottom < sy
      }
      s match {
        case 'D'::ss ⇒ canDropColumn(ss, tx, newUp, newBottom - 1)
        case 'U'::ss ⇒ canDropColumn(ss, tx, newUp + 1, newBottom)
        case _::ss ⇒ canDropColumn(ss, tx, newUp, newBottom)
        case Nil ⇒ ???
      }
    }
    val revs = s.reverseIterator.toList
    val revt = t.reverseIterator.toList
    !canDropRow(revs, revt, 1, w) && !canDropColumn(revs, revt, 1, h)
  }
}