#include <bits/stdc++.h>

using namespace std;

#define MAXH 200010
#define MAXW 200010
#define MAXN 200010

int h, w, n;
int sr, sc;
char s[3][MAXN];
map<char, stack<int> > pilha;
int prob_row[MAXH];
int prob_col[MAXW];

void imprimirFilas() {
    stack<int> aux[1000];
    char d[4]={'R', 'L', 'D', 'U'};
    int i, j;
    for (i=0; i<4; i++) {
        aux[d[i]]=pilha[d[i]];
    }
    for (i=0; i<4; i++) {
        printf("fila %c:", d[i]);
        while (aux[d[i]].size()>0){
            printf(" %d", aux[d[i]].top());
            aux[d[i]].pop();
        }
        printf("\n");
    }
    printf("\n");

}

int main() {
    scanf("%d %d %d", &h, &w, &n);
    scanf("%d %d", &sr, &sc);
    int i, j;
    for (i=1; i<=2; i++) {
        scanf("%s", s[i]+1);
    }

    for (i=n; i>=1; i--) {

        // pilhaR
        if (s[1][i]=='R') {
            if (s[2][i]=='L') {
                if (pilha['R'].size()==0) {
                    pilha['R'].push(w);
                }
            }
            else {
                if (pilha['R'].size()==0) {
                    pilha['R'].push(w);
                }
                else if (pilha['R'].top()!=1){
                    pilha['R'].push(pilha['R'].top()-1);
                }
            }
        }
        else if (s[2][i]=='L') {
            if (pilha['R'].size()>0 && pilha['R'].top()!=1) {
                pilha['R'].pop();
            }
        }

        //pilhaL
        if (s[1][i]=='L') {
            if (s[2][i]=='R') {
                if (pilha['L'].size()==0) {
                    pilha['L'].push(1);
                }
            }
            else {
                if (pilha['L'].size()==0) {
                    pilha['L'].push(1);
                }
                else if (pilha['L'].top()!=w){
                    pilha['L'].push(pilha['L'].top()+1);
                }
            }
        }
        else if (s[2][i]=='R') {
            if (pilha['L'].size()>0 && pilha['L'].top()!=w) {
                pilha['L'].pop();
            }
        }

        //pilhaD
        if (s[1][i]=='D') {
            if (s[2][i]=='U') {
                if (pilha['D'].size()==0) {
                    pilha['D'].push(h);
                }
            }
            else {
                if (pilha['D'].size()==0) {
                    pilha['D'].push(h);
                }
                else if (pilha['D'].top()!=1) {
                    pilha['D'].push(pilha['D'].top()-1);
                }
            }
        }
        else if (s[2][i]=='U') {
            if (pilha['D'].size()>0 && pilha['D'].top()!=1) {
                pilha['D'].pop();
            }
        }


        // pilhaU
        if (s[1][i]=='U') {
            if (s[2][i]=='D') {
                if (pilha['U'].size()==0) {
                    pilha['U'].push(1);
                }
            }
            else {
                if (pilha['U'].size()==0) {
                    pilha['U'].push(1);
                }
                else if (pilha['U'].top()!=h) {
                    pilha['U'].push(pilha['U'].top()+1);
                }
            }
        }
        else if (s[2][i]=='D') {
            if (pilha['U'].size()>0 && pilha['U'].top()!=h) {
                pilha['U'].pop();
            }
        }

        //printf("**** %d\n", i);
        //imprimirFilas();


    }


    while (!pilha['R'].empty()) {
        prob_col[pilha['R'].top()]=1;
        pilha['R'].pop();
    }
    while (!pilha['L'].empty()) {
        prob_col[pilha['L'].top()]=1;
        pilha['L'].pop();
    }
    while (!pilha['D'].empty()) {
        prob_row[pilha['D'].top()]=1;
        pilha['D'].pop();
    }
    while (!pilha['U'].empty()) {
        prob_row[pilha['U'].top()]=1;
        pilha['U'].pop();
    }

    if (prob_row[sr]==0 && prob_col[sc]==0) {
        printf("YES\n");
    }
    else {
        printf("NO\n");
    }

    return 0;
}








Measured memory_bytes: 1920