H, W, N = gets.strip.split(/ /).collect(&:to_i)
y, x = gets.strip.split(/ /).collect(&:to_i)

S = gets.strip.split(//)
T = gets.strip.split(//)

def check(s, t, i, w, c1, c2)
	win_min = 1
	win_max = w
	
	N.times.reverse_each{|j|
		if j < N - 1
			tc = t[j]
			if tc == c1
				win_max += 1
			elsif tc == c2
				win_min -= 1
			end
			if win_max > w
				win_max = w
			end
			if win_min < 1
				win_min = 1
			end
		end
		sc = s[j]
		if sc == c1
			win_min += 1
		elsif sc == c2
			win_max -= 1
		end
		if win_max > w
			win_max = w
		end
		if win_min < 1
			win_min = 1
		end
		if win_max < win_min
			return false
		end
	}
	if win_min <= i && win_max >= i
		return true
	else
		return false
	end
end

if check(S, T, x, W, 'L', 'R') && check(S, T, y, H, 'U', 'D')
	puts "YES"
else
	puts "NO"
end




