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

dpH = Array.new(N + 1) { Hash.new }
dpH[0][SR] = true
dpW = Array.new(N + 1) { Hash.new }
dpW[0][SC] = true

S.zip(T).each_with_index do |(s, t), i|
  out_of_grid_h = true

  dpH[i].each_key do |k|
    if 1 <= k && k <= N
      out_of_grid_h = false
    end

    dpH[i + 1][k] = true
  end

  out_of_grid_w = true

  dpW[i].each_key do |k|
    if 1 <= k && k <= N
      out_of_grid_w = false
    end

    dpW[i + 1][k] = true
  end

  if !out_of_grid_h || !out_of_grid_w
    puts 'NO'
    exit
  end

  case s
  when 'R'
    dpH[i].each_key do |k|
      dpH[i + 1][k + 1] = true
    end
  when 'L'
    dpH[i].each_key do |k|
      dpH[i + 1][k - 1] = true
    end
  when 'U'
    dpW[i].each_key do |k|
      dpW[i + 1][k - 1] = true
    end
  when 'D'
    dpW[i].each_key do |k|
      dpW[i + 1][k + 1] = true
    end
  end
end

puts 'YES'
