#include<bits/stdc++.h>
using namespace std;

int main(){
    size_t H, W, N;
    cin >> H >> W >> N;
    size_t sr, sc;
    cin >> sr >> sc;
    string S, T;
    cin >> S >> T;

    size_t u = sr, d = sr, r = sc, l = sc;
    auto f = [&u, &d, &r, &l](char a){
        if(a == 'U')--u;
        if(a == 'D')++d;
        if(a == 'R')++r;
        if(a == 'L')--l;
    };
    for(unsigned long i = 0; i < N; ++i){
        f(S[i]);
        if(u == 0 || l == 0 || d > H || r > W)return 0 & puts("NO");
        swap(u, d);
        swap(r, l);
        f(T[i]);
        swap(u, d);
        swap(r, l);
        d = max(1UL, d);
        u = min(H, u);
        l = min(W, l);
        r = max(1UL, r);
    }
    puts("YES");
    return 0;
}