import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv, std.math,
    std.functional, std.numeric, std.range, std.stdio, std.string, std.random,
    std.typecons, std.container, std.format, std.datetime;

// dfmt off
T lread(T = long)(){return readln.chomp.to!T();}
T[] lreads(T = long)(long n){return generate(()=>readln.chomp.to!T()).take(n).array();}
T[] aryread(T = long)(){return readln.split.to!(T[])();}
void scan(TList...)(ref TList Args){auto line = readln.split();
foreach (i, T; TList){T val = line[i].to!(T);Args[i] = val;}}
alias sread = () => readln.chomp();enum MOD = 10 ^^ 9 + 7;
alias PQueue(T, alias less = "a<b") = BinaryHeap!(Array!T, less);
// dfmt on

void main()
{
    long H, W, N;
    scan(H, W, N);
    long SR, SC;
    scan(SR, SC);
    auto S = sread();
    auto T = sread();
    long l = SC;
    long r = W - SC + 1;
    long u = SR;
    long d = H - SR + 1;
    foreach (i; 0 .. N)
    {
        switch (S[i])
        {
        case 'L':
            l--;
            break;
        case 'R':
            r--;
            break;
        case 'U':
            u--;
            break;
        case 'D':
            d--;
            break;
        default:
            assert(0);
        }
        // writefln("%s %s %s %s", l, r, u, d);
        if (l <= 0 || r <= 0 || u <= 0 || d <= 0)
        {
            writeln("NO");
            return;
        }
        switch (T[i])
        {
        case 'L':
            if (r < W)
                r++;
            break;
        case 'R':
            if (l < W)
                l++;
            break;
        case 'U':
            if (d < H)
                d++;
            break;
        case 'D':
            if (u < H)
                u++;
            break;
        default:
            assert(0);
        }
    }
    writeln("YES");
}
