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

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

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