h,w,n = gets.split.map(&:to_i)
x,y = gets.split.map(&:to_i)
s = gets.chomp
t = gets.chomp

u = d = x
l = r = y
n.times do |i|
    if s[i] == "L"
        l -= 1
    elsif s[i] == "R"
        r += 1
    elsif s[i] == "U"
        u -= 1
    else
        d += 1
    end
    if l <= 0 || r > w || u <= 0 || d > h
        puts "NO"
        exit
    end
    if t[i] == "L"
        r -= 1
        r = 1 if r <= 0
    elsif t[i] == "R"
        l += 1
        l = w if l > w
    elsif t[i] == "U"
        d -= 1
        d = 1 if d < 1
    else
        u += 1
        u = h if u > h
    end
end
puts "YES"