local h, w, n = io.read("*n", "*n", "*n", "*l")
local sr, sc = io.read("*n", "*n", "*l")
local s = io.read()
local t = io.read()
local safe_l, safe_r, safe_t, safe_b = 1, w, 1, h
local isok = true
local mma, mmi = math.max, math.min
for i = n, 1, -1 do
  local tt = t:sub(i, i)
  if tt == "L" then
    safe_r = mmi(safe_r + 1, w)
  elseif tt == "R" then
    safe_l = mma(safe_l - 1, 1)
  elseif tt == "U" then
    safe_b = mmi(safe_b + 1, h)
  else
    safe_t = mma(safe_t - 1, 1)
  end
  local ss = s:sub(i, i)
  if ss == "L" then
    safe_l = safe_l + 1
    if safe_r < safe_l then isok = false break end
  elseif ss == "R" then
    safe_r = safe_r - 1
    if safe_r < safe_l then isok = false break end
  elseif ss == "U" then
    safe_t = safe_t + 1
    if safe_b < safe_t then isok = false break end
  else
    safe_b = safe_b - 1
    if safe_b < safe_t then isok = false break end
  end
  if not isok then break end
end
if isok then
  isok = safe_t <= sr and sr <= safe_b and safe_l <= sc and sc <= safe_r
end
print(isok and "YES" or "NO")
