fun main(args: Array<String>) {
    val (h,w,n) = readLine()!!.split(" ").map { it.toInt() }
    val (y,x)= readLine()!!.split(" ").map { it.toInt() }
    val s = readLine()!!
    val t = readLine()!!

    var py = y
    for (i in 0..n-1){
        if(s[i]=='U') py--
        if(py==0){ println("NO"); return }
        if(t[i]=='D' && py<h) py++
    }

    py = y
    for (i in 0..n-1){
        if(s[i]=='D') py++
        if(py==h+1){ println("NO"); return }
        if(t[i]=='U' && py>1) py--
    }

    var px = x
    for (i in 0..n-1){
        if(s[i]=='R') px++
        if(px==w+1){ println("NO"); return }
        if(t[i]=='L' && px>1) px--
    }

    px = x
    for (i in 0..n-1){
        if(s[i]=='L') px--
        if(px==0){ println("NO"); return }
        if(t[i]=='R' && px<w) px++
    }

    println("YES")

}