local ior = io.input()
local h, w, n = ior:read("*n", "*n", "*n")
local sr, sc = ior:read("*n", "*n", "*l")
local s = ior:read()
local t = ior:read()
local s_left, s_right, s_up, s_down = {}, {}, {}, {}
local t_left, t_right, t_up, t_down = {}, {}, {}, {}
local str = ""
str = s:sub(1, 1)
s_left[1] = str == "L" and 1 or 0
s_right[1] = str == "R" and 1 or 0
s_up[1] = str == "U" and 1 or 0
s_down[1] = str == "D" and 1 or 0

str = t:sub(1, 1)
t_left[1] = str == "L" and 1 or 0
t_right[1] = str == "R" and 1 or 0
t_up[1] = str == "U" and 1 or 0
t_down[1] = str == "D" and 1 or 0
if(sc == 1) then t_left[1] = 0 end
if(sc == w) then t_right[1] = 0 end
if(sr == 1) then t_up[1] = 0 end
if(sr == h) then t_down[1] = 0 end

local mma, mmi = math.max, math.min

for i = 2, n do
  str = s:sub(i, i)
  s_left[i] = s_left[i - 1] + (str == "L" and 1 or 0)
  s_right[i] = s_right[i - 1] + (str == "R" and 1 or 0)
  s_up[i] = s_up[i - 1] + (str == "U" and 1 or 0)
  s_down[i] = s_down[i - 1] + (str == "D" and 1 or 0)
  str = t:sub(i, i)
  t_left[i] = t_left[i - 1] + (str == "L" and 1 or 0)
  t_left[i] = mmi(sc - 1, t_left[i])
  t_right[i] = t_right[i - 1] + (str == "R" and 1 or 0)
  t_right[i] = mmi(w - sc, t_right[i])
  t_up[i] = t_up[i - 1] + (str == "U" and 1 or 0)
  t_up[i] = mmi(sr - 1, t_up[i])
  t_down[i] = t_down[i - 1] + (str == "D" and 1 or 0)
  t_down[i] = mmi(h - sr, t_down[i])
end

local leftlim, rightlim = sc, w + 1 - sc
local uplim, downlim = sr, h + 1 - sr

local fin = false
if(
  (leftlim <= s_left[1]) or
  (rightlim <= s_right[1]) or
  (uplim <= s_up[1]) or
  (downlim <= s_down[1])
) then
  print("NO")
  fin = true
end
if(not fin) then
  for i = 2, n do
    if(
      (leftlim <= s_left[i] - t_right[i - 1]) or
      (rightlim <= s_right[i] - t_left[i - 1]) or
      (uplim <= s_up[i] - t_down[i - 1]) or
      (downlim <= s_down[i] - t_up[i - 1])
    ) then
      print("NO")
      fin = true
    end
  end
end
if(not fin) then print("YES") end
