h,w,n = gets.split.map(&:to_i)
sr,sc = gets.split.map(&:to_i)
s = gets.chomp.split('')
t = gets.chomp.split('')
hh = Hash.new(0)
th = Hash.new(0)
c = {'L' => 'R', 'R' => 'L', 'U' => 'D', 'D' => 'U'}
s.each_index do |i|
  hh[s[i]] += 1
  if hh['L'] >= sc || hh['R'] > w - sc || hh['U'] >= sr || hh['D'] > h - sr
    puts 'NO'
    exit
  end
  case t[i]
  when 'L'
    next if th['L'] >= sc - 1
  when 'R'
    next if th['R'] >= w - sc
  when 'U'
    next if th['U'] >= sr - 1
  when 'D'
    next if th['D'] >= h - sr
  end
  th[t[i]] += 1
  hh[c[t[i]]] -= 1
end
puts 'YES'
