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

r = Array.new(W + 2, false)
r[W + 1] = true
right = W + 1

l = Array.new(W + 2, false)
l[0] = true
left = 0

u = Array.new(H + 2, false)
u[0] = true
up = 0

d = Array.new(H + 2, false)
d[H + 1] = true
down = 0

(N - 1).downto(0) do |i|
  s = S[i]
  t = T[i]

  case s
  when 'R'
    right -= 1
  when 'L'
    left += 1
  when 'U'
    up += 1
  when 'D'
    down -= 1
  end

  r[right] = true
  l[left] = true
  u[up] = true
  d[down] = true

  next if i == N - 1

  case t
  when 'R'
    l[left] = false
    left -= 1
  when 'L'
    r[right] = false
    right += 1
  when 'D'
    u[up] = false
    up -= 1
  when 'U'
    d[down] = false
    down += 1
  end

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

puts 'YES'
