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

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

s = gets.chomp.chars
t = gets.chomp.chars

x = sc
0.upto(n-1) do |i|
  if s[i] == 'L'
    x -= 1
  end
  if x < 1
    puts "NO"
    exit
  end
  if t[i] == 'R'
    x = [x + 1, w].min
  end
end

x = sc
0.upto(n-1) do |i|
  if s[i] == 'R'
    x += 1
  end
  if x > w
    puts "NO"
    exit
  end
  if t[i] == 'L'
    x = [x - 1, 1].max
  end
end

y = sr
0.upto(n-1) do |i|
  if s[i] == 'U'
    y -= 1
  end
  if y < 1
    puts "NO"
    exit
  end
  if t[i] == 'D'
    y = [y + 1, h].min
  end
end

y = sr
0.upto(n-1) do |i|
  if s[i] == 'D'
    y += 1
  end
  if y > h
    puts "NO"
    exit
  end
  if t[i] == 'U'
    y = [y - 1, 1].max
  end
end

puts "YES"
