import java.lang.Math

fun main(args: Array<String>) {
    val (H, W, N) = readInputLine().split(" ").map { it.toInt() }
    val (sy, sx) = readInputLine().split(" ").map { it.toInt() }
    val S = readInputLine().reversed().toCharArray()
    val T = readInputLine().reversed().toCharArray()

    // 左右レンジチェック
    var low = 1
    var high = W
    for (i in 0 until N) {
        when (T[i]) {
            'L' -> high = Math.min(W, high + 1)
            'R' -> low = Math.max(1, low - 1)
        }
        when (S[i]) {
            'L' -> low++
            'R' -> high--
        }
        if (low > high) {
            println("NO")
            return
        }
    }

    if (sx < low || high < sx) {
        println("NO")
        return
    }

    // 上下レンジチェック
    low = 1
    high = H
    for (i in 0 until N) {
        when (T[i]) {
            'U' -> high = Math.min(H, high + 1)
            'D' -> low = Math.max(1, low - 1)
        }
        when (S[i]) {
            'U' -> low++
            'D' -> high--
        }
        if (low > high) {
            println("NO")
            return
        }
    }

    if (sy < low || high < sy) {
        println("NO")
        return
    }

    println("YES")
}

fun readInputLine(): String {
    return readLine()!!
}
