H,W,N=gets.split.map &:to_i
y,x=gets.split.map &:to_i
S=gets.chomp
T=gets.chomp
yU=y-1
yD=y-1
xL=x-1
xR=x-1
N.times{|i|
    if S[i]=='L' then
        xL-=1
    elsif S[i]=='R' then
        xR+=1
    elsif S[i]=='U' then
        yU-=1
    else
        yD+=1
    end
    if xL<0||xR>=W||yU<0||yD>=H then
        puts "NO"
        exit
    end
    if T[i]=='L'&&xR>0 then
        xR-=1
    elsif T[i]=='R'&&xL<W-1 then
        xL+=1
    elsif T[i]=='U'&&yD>0 then
        yD-=1
    elsif yU<H-1 then
        yU+=1
    end
}
puts "YES"