#!/usr/bin/env ruby

def overflow?(dp_i)
  [:U, :D, :L, :R].each do |sym|
    if dp_i[sym][:limit] - dp_i[sym][:S] + dp_i[sym][:T] < 0
      return true
    end
  end
  return false
end

if $0 == __FILE__
  H, W, N = gets.split(' ').map &:to_i
  sr, sc = gets.split(' ').map &:to_i
  S = gets.chomp.split('')
  T = gets.chomp.split('')

  u_limit = sr - 1
  d_limit = H - sr
  l_limit = sc - 1
  r_limit = W - sc

  # dp[i][L or R or D or U]: i番目までSが上下左右に全ブリした場合の残りカウントとTが逆ぶりできる猶予個数
  # dp[i] = {
  #   L: [残りカウント, 猶予],
  #   ...
  #   }
  dp = []

  (0...N).each do |i|
    dp[i] = {
      U: {
        limit: u_limit,
        S: i == 0 ? 0 : dp[i-1][:U][:S],
        T: i == 0 ? 0 : dp[i-1][:U][:T]
      },
      D: {
        limit: d_limit,
        S: i == 0 ? 0 : dp[i-1][:D][:S],
        T: i == 0 ? 0 : dp[i-1][:D][:T]
      },
      L: {
        limit: l_limit,
        S: i == 0 ? 0 : dp[i-1][:L][:S],
        T: i == 0 ? 0 : dp[i-1][:L][:T]
      },
      R: {
        limit: r_limit,
        S: i == 0 ? 0 : dp[i-1][:R][:S],
        T: i == 0 ? 0 : dp[i-1][:R][:T]
      }
    }

    case S[i]
    when 'U'
      dp[i][:U][:S] += 1
    when 'D'
      dp[i][:D][:S] += 1
    when 'L'
      dp[i][:L][:S] += 1
    when 'R'
      dp[i][:R][:S] += 1
    end

    if overflow?(dp[i])
      puts 'NO'
      exit
    end

    case T[i]
    when 'U'
      if u_limit - (dp[i][:D][:T]+1) - dp[i][:U][:S] >= 0
        dp[i][:D][:T] += 1
      end
    when 'D'
      if d_limit - (dp[i][:U][:T]+1) - dp[i][:D][:S] >= 0
        dp[i][:U][:T] += 1
      end
    when 'L'
      if l_limit - (dp[i][:R][:T]+1) - dp[i][:L][:S] >= 0
        dp[i][:R][:T] += 1
      end
    when 'R'
      if r_limit - (dp[i][:L][:T]+1) - dp[i][:R][:S] >= 0
        dp[i][:L][:T] += 1
      end
    end
  end

  puts 'YES'
end
