#include "bits/stdc++.h"
using namespace std;
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define put(a) cout<<a<<"\n"
#define all(a)  (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){if(a>b){a=b;return 1;}return 0;}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){if(a<b){a=b;return 1;}return 0;}

int main(){
    int h,w,n;
    cin >> h >> w >> n;
    int sr,sc;
    cin >> sr >> sc;
    string s,t;
    cin >> s >> t;
    
    bool flag = true;
    //
    vector<int> cl(n+1);
    cl.back() = 0;
    RREP(i,n){
        if(s[i]=='L'&&t[i]!='R'){
            cl[i]=cl[i+1]+1;
        }else if(s[i]!='L'&&t[i]=='R'){
            cl[i]=max(cl[i+1]-1,0);
        }else{
            cl[i]=cl[i+1];
        }
    }
    if(cl[0]>=sc){
        flag = false;
    }
    int cnt = 0;
    int rb = w-sc+1;
    REP(i,n){
        if(s[i]=='R'){
            cnt++;
            if(rb<=cnt){
                flag = false;
            }
        }
        if(t[i]=='L'){
            cnt = max(cnt-1,cl[i+1]-sc+1);
        }
    }
    //
    vector<int> cr(n+1);
    cr.back() = 0;
    RREP(i,n){
        if(s[i]=='R'&&t[i]!='L'){
            cr[i]=cr[i+1]+1;
        }else if(s[i]!='R'&&t[i]=='L'){
            cr[i]=max(cr[i+1]-1,0);
        }else{
            cr[i]=cr[i+1];
        }
    }
    if(cr[0]>=w-sc+1){
        flag = false;
    }
    cnt = 0;
    int lb = sc;
    REP(i,n){
        if(s[i]=='L'){
            cnt++;
            if(lb<=cnt){
                flag = false;
            }
        }
        if(t[i]=='R'){
            cnt = max(cnt-1,-(w-sc-cr[i+1]));//min?
        }
    }
    //
    vector<int> cu(n+1);
    cu.back() = 0;
    RREP(i,n){
        if(s[i]=='U'&&t[i]!='D'){
            cu[i]=cu[i+1]+1;
        }else if(s[i]!='U'&&t[i]=='D'){
            cu[i]=max(cu[i+1]-1,0);
        }else{
            cu[i]=cu[i+1];
        }
    }
    if(cu[0]>=sr){
        flag = false;
    }
    cnt = 0;
    int db = h-sr+1;
    REP(i,n){
        if(s[i]=='D'){
            cnt++;
            if(db<=cnt){
                flag = false;
            }
        }
        if(t[i]=='U'){
            cnt = max(cnt-1,cu[i+1]-sr+1);
        }
    }
    //
    vector<int> cd(n+1);
    cd.back() = 0;
    RREP(i,n){
        if(s[i]=='D'&&t[i]!='U'){
            cd[i]=cd[i+1]+1;
        }else if(s[i]!='D'&&t[i]=='U'){
            cd[i]=max(cd[i+1]-1,0);
        }else{
            cd[i]=cd[i+1];
        }
    }
    if(cd[0]>=h-sr+1){
        flag = false;
    }
    cnt = 0;
    int ub = sr;
    REP(i,n){
        if(s[i]=='U'){
            cnt++;
            if(ub<=cnt){
                flag = false;
            }
        }
        if(t[i]=='D'){
            cnt = max(cnt-1,-(h-sr-cd[i+1]));//min?
        }
    }
    if(flag){
        put("YES");
    }else{
        put("NO");
    }
    return 0;
}


Measured memory_bytes: 3848