h,w,n=gets.split.map(&:to_i)
sr,sc=gets.split.map(&:to_i)
s=gets.chomp.chars
t=gets.chomp.chars
r,c=sr,sc
n.times do |i|
  if s[i]=="U"
    r-=1
    if r<1
      puts "NO"
      exit
    end
  elsif s[i]=="L"
    c-=1
    if c<1
      puts "NO"
      exit
    end
  end
  if t[i]=="D"
    r+=1 if r<h
  elsif t[i]=="R"
    c+=1 if c<w
  end
end
r,c=sr,sc
n.times do |i|
  if s[i]=="D"
    r+=1
    if r>h
      puts "NO"
      exit
    end
  elsif s[i]=="R"
    c+=1
    if c>w
      puts "NO"
      exit
    end
  end
  if t[i]=="U"
    r-=1 if r>1
  elsif t[i]=="L"
    c-=1 if c>1
  end
end
puts "YES"
