h, w, n = gets.split.map(&:to_i)
sr, sc = gets.split.map(&:to_i)

s = gets.chomp
t = gets.chomp

a = [sc, sc, sr, sr]
n.times do |i|
    case s[i]
    when ?L
        a[0] -= 1
    when ?R
        a[1] += 1
    when ?U
        a[2] -= 1
    else
        a[3] += 1
    end
    
    break if a[0] == 0 || a[1] > w || a[2] == 0 || a[3] > h

    case t[i]
    when ?L
        a[1] -= 1 if a[1] > 1
    when ?R
        a[0] += 1 if a[0] < w
    when ?U
        a[3] -= 1 if a[3] > 1
    else
        a[2] += 1 if a[2] < h
    end
end or (puts "NO"; exit)

puts "YES"
