#include <bits/stdc++.h>
#include<iostream>
#include<fstream>
#define ll long long
using namespace std;

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

    int left = 0, right = W+1, down = H+1, up = 0;
    for(int i=N-1; i>=0; i--){
        if(T[i]=='L') right = min(right+1, W+1);
        if(T[i]=='R') left = max(left-1, 0);
        if(T[i]=='U') down = min(down+1, H+1);
        if(T[i]=='D') up = max(up-1, 0);
        if(S[i]=='L') left++;
        if(S[i]=='R') right--;
        if(S[i]=='U') up++;
        if(S[i]=='D') down--;

        if(right - left <= 1 || down - up <= 1){
            cout << "NO" << endl;
            return 0;
        }
    }
    if(left < sc && sc < right && up < sr && sr < down){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
}
