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

aoki_win_left = 1
aoki_win_right = w
(n - 1).downto(0) do |i|
  case aoki[i]
  when "R"
    aoki_win_left -= 1 if aoki_win_left > 1
  when "L"
    aoki_win_right += 1 if aoki_win_right < w
  end
  case takahashi[i]
  when "R"
    aoki_win_right -= 1
  when "L"
    aoki_win_left += 1
  end
  # if aoki_win_right < aoki_win_left
  #   puts "NO"
  #   exit
  # end
end

aoki_win_up = 1
aoki_win_down = h
(n - 1).downto(0) do |i|
  case aoki[i]
  when "D"
    aoki_win_up -= 1 if aoki_win_up > 1
  when "U"
    aoki_win_down += 1 if aoki_win_down < h
  end
  case takahashi[i]
  when "D"
    aoki_win_down -= 1
  when "U"
    aoki_win_up += 1
  end
  # if aoki_win_down < aoki_win_up
  #   puts "NO"
  #   exit
  # end
end

if sr.between?(aoki_win_up, aoki_win_down) && sc.between?(aoki_win_left, aoki_win_right)
  puts "YES"
else
  puts "NO"
end