H, W, N = gets.split.map(&:to_i)
SR, SC = gets.split.map(&:to_i)
S = gets.chomp.chars
T = gets.chomp.chars

left = right = SC
up = down = SR

S.zip(T).each_with_index do |(s, t), i|
  case s
  when 'R'
    right += 1
  when 'L'
    left -= 1
  when 'U'
    up -= 1
  when 'D'
    down += 1
  end

  if left < 1 || up < 1 || W < right || H < down
    puts 'NO'
    exit
  end

  case t
  when 'R'
    left = [N, right, left + 1].min
  when 'L'
    right = [1, left, right - 1].max
  when 'U'
    down = [1, up, down - 1].max
  when 'D'
    up = [N, down, up + 1].min
  end
end

puts 'YES'
