#!/usr/bin/env ruby

UP=1
DOWN=2
LEFT=3
RIGHT=4

def safe_add(array, position, updown_flag)
  threshold = updown_flag ? H : W
  if 0 <= position and position < threshold
    array << position
  end
end

def first_move_only(array, i, direction)
  case direction
  when UP
    offset = 1
    updown_flag = true
  when DOWN
    offset = -1
    updown_flag = true
  when LEFT
    offset = 1
    updown_flag = false
  when RIGHT
    offset = -1
    updown_flag = false
  end

  array[i+1].each do |place|
    safe_add(array[i], place, updown_flag)
    safe_add(array[i], place + offset, updown_flag)
  end
end

def move_same_direction(array, i, direction)
  case direction
  when UP
    offset_check = -1
    offset_add   = 1
    updown_flag = true
  when DOWN
    offset_check = 1
    offset_add   = -1
    updown_flag = true
  when LEFT
    offset_check = -1
    offset_add   = 1
    updown_flag = false
  when RIGHT
    offset_check = 1
    offset_add   = -1
    updown_flag = false
  end
  threshold = updown_flag ? H : W

  array[i+1].each do |place|
    if place + offset_check < 0 or threshold <= place + offset_check
      safe_add(array[i], place, updown_flag)
      safe_add(array[i], place + offset_add, updown_flag)
    elsif array[i+1].find(place + offset_check)
      safe_add(array[i], place, updown_flag)
    end
  end
end

def move_opposite_direction(array, i, direction)
  case direction
  when UP
    offset_same_direction    = -1
    offset_against_direction = 1
    updown_flag = true
  when DOWN
    offset_same_direction    = 1
    offset_against_direction = -1
    updown_flag = true
  when LEFT
    offset_same_direction    = -1
    offset_against_direction = 1
    updown_flag = false
  when RIGHT
    offset_same_direction    = 1
    offset_against_direction = -1
    updown_flag = false
  end
  threshold = updown_flag ? H : W

  array[i+1].each do |place|
    check_position1 = place + offset_against_direction
    check_position2 = place + offset_same_direction
    if check_position1 < 0 or threshold <= check_position1
      safe_add(array[i], place, updown_flag)
    elsif array[i+1].find(check_position1)
      safe_add(array[i], place, updown_flag)
    elsif check_position2 < 0 or threshold <= check_position2
      # nothing to do
    elsif array[i+1].find(check_position2)
      safe_add(array[i], place, updown_flag)
    end
  end
end

def copy_the_last(array, i)
  array[i] = array[i+1]
end


if $0 == __FILE__
  H, W, N = gets.split(' ').map &:to_i
  Sr, Sc = gets.split(' ').map &:to_i

  S = []
  gets.chomp.split('').each do |s|
    case s
    when 'U'
      S << UP
    when 'D'
      S << DOWN
    when 'L'
      S << LEFT
    when 'R'
      S << RIGHT
    end
  end
  T = []
  gets.chomp.split('').each do |s|
    case s
    when 'U'
      T << UP
    when 'D'
      T << DOWN
    when 'L'
      T << LEFT
    when 'R'
      T << RIGHT
    end
  end



  # i手開始前に後手(青木君)がいたら負ける位置(上下)
  places_ud = Array.new(N)
  # i手開始前に後手(青木君)がいたら負ける位置(左右)
  places_lr = Array.new(N)

  (N-1).downto(0).each do |i|
    places_ud[i] = []
    places_lr[i] = []
    case S[i]
    when UP
      places_ud[i] << 0
    when DOWN
      places_ud[i] << H-1
    when LEFT
      places_lr[i] << 0
    when RIGHT
      places_lr[i] << W-1
    end

    next if i == N-1

    # 前回(i+1)の負ける位置(対象位置)それぞれについて、
    # 対象位置とその上下左右(対象上下左右位置)を
    # 今回(i)の負ける位置として追加するかどうか
    case S[i]
    when UP
      case T[i]
      when UP
        move_same_direction(places_ud, i, S[i])
      when DOWN
        move_opposite_direction(places_ud, i, S[i])
      when LEFT
        first_move_only(places_ud, i, S[i])
      when RIGHT
        first_move_only(places_ud, i, S[i])
      end

      copy_the_last(places_lr, i)

      places_ud[i].uniq!
    when DOWN
      case T[i]
      when UP
        move_opposite_direction(places_ud, i, S[i])
      when DOWN
        move_same_direction(places_ud, i, S[i])
      when LEFT
        first_move_only(places_ud, i, S[i])
      when RIGHT
        first_move_only(places_ud, i, S[i])
      end

      copy_the_last(places_lr, i)

      places_ud[i].uniq!
    when LEFT
      case T[i]
      when UP
        # 対象位置 + 対象右位置を追加
        first_move_only(places_lr, i, S[i])
      when DOWN
        # 対象位置 + 対象右位置を追加
        first_move_only(places_lr, i, S[i])
      when LEFT
        # 対象左位置が負け位置でない場合
        #   -> なにもしない
        # 対象左位置が負け位置な場合
        #   -> 対象右位置を追加
        # 対象左位置が移動不可の場合
        #   -> 対象位置 + 対象右を追加
        move_same_direction(places_lr, i, S[i])
      when RIGHT
        # 対象左も右も負け位置でない
        #   -> なにもしない
        # 対象左 or 右が負け位置
        #   -> 対象位置を追加
        # 対象右が移動不可
        #   -> 対象位置を追加
        # 対象左が移動不可
        #   -> なにもしない
        move_opposite_direction(places_lr, i, S[i])
      end

      copy_the_last(places_ud, i)

      places_lr[i].uniq!
    when RIGHT
      case T[i]
      when UP
        first_move_only(places_lr, i, S[i])
      when DOWN
        first_move_only(places_lr, i, S[i])
      when LEFT
        move_opposite_direction(places_lr, i, S[i])
      when RIGHT
        move_same_direction(places_lr, i, S[i])
      end

      copy_the_last(places_ud, i)

      places_lr[i].uniq!
    end
  end

  if places_ud[0].include? Sr or places_lr[0].include? Sc
    puts 'NO'
  else
    puts 'YES'
  end
end
