#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define int long long
#define vec(a,n) vector<int> (a)((n))
#define Vec(a,n) vector<string> (a)((n))
#define twovec(a,n,m) vector<vector<int>> a(n,vector<int>(m,0))
#define Twovec(a,n,m) vector<vector<double>> a(n,vector<double>(m,0))
#define P pair<int,int>
#define All(a) (a).begin(),(a).end()
#define Sort(a) sort(All(a))
#define Reverse(a) reverse(All(a))
#define PQ(n) priority_queue<P,vector<P>,greater<P>> (n)
#define pq(n) priority_queue<int> (n)
using namespace std;
int max_int = 1000000007;
void Debug(auto a);
int nibul(auto a,auto b);
int nibuu(auto a,auto b);
class Modulo{
public:
    int val;
    static const int mod = 1e9+7;
    vector<int> factable = {1};
    vector<int> invtable = {1};
    int pro(int x,int y){return ((x%mod)*(y%mod))%mod;}
    int sum(int x,int y){return ((x%mod)+(y%mod))%mod;}
    int dif(int x,int y){int d =((x%mod)-(y%mod))%mod;if(d>=0){return d;}else{return d+mod;}}
    int quo(int x, int y){return pro(x,pow(y,mod-2));}
    int pow(int x,int y){
        if(y<=0){return 1;}
        if(y%2==0){int d = pow(x,y/2);return ((d%mod)*(d%mod))%mod;}
        else{return (x*pow(x,y-1))%mod;}
    }
    void operator=(int n){this->val = n%mod;}
    int operator+(int n){return sum(this->val,n);}
    int operator-(int n){return dif(this->val,n);}
    int operator*(int n){return pro(this->val,n);}
    int operator/(int n){return quo(this->val,n);}
    void operator+=(int n){this->val = sum(this->val,n);}
    void operator-=(int n){this->val = dif(this->val,n);}
    void operator*=(int n){this->val = pro(this->val,n);}
    void operator/=(int n){this->val = quo(this->val,n);}
    int fac(int x){
        //x! mod mod
        if(factable.size()<=x){
            int s = factable.size();
            FOR(i,s,x+1){
                factable.push_back(pro(i,factable.back()));
                invtable.push_back(quo(1,factable.back()));
            }
        }
        if(x<0) return 1;
        else return factable[x];
    }
    int facinv(int x){
        if(invtable.size()<=x){
            int s = invtable.size();
            FOR(i,s,x+1){
                factable.push_back(pro(i,factable.back()));
                invtable.push_back(quo(1,factable.back()));
            }
        }
        if(x<0) return 1;
        else return invtable[x];
    }
    int com(int x,int y){
        //xCy mod mod = x!/((x-y)!*y!) mod mod
        if(x-y<y)return com(x,x-y);
        return pro(fac(x),pro(facinv(x-y),facinv(y)));
    }
};

struct  Test{

};


int n,m;

signed main(){
    int h,w;
    cin >> h >> w >> n;
    int sr,sc;
    cin >> sr >> sc;
    string s,t;
    cin >> s >> t;
    int tmpx = sr,tmpy = sc;
    bool ans = true;
    REP(i,n){
        if(s[i] == 'U'){
            tmpx--;
        }
        if(tmpx == 0){
            ans = false;
        }
        if(t[i] == 'D' && tmpx < h){
            tmpx++;
        }
        if(tmpx == 0){
            ans = false;
        }
    }
    tmpx = sr;
    REP(i,n){
        if(s[i] == 'D'){
            tmpx++;
        }
        if(tmpx == h+1){
            ans = false;
        }
        if(t[i] == 'U' && tmpx > 1){
            tmpx--;
        }
        if(tmpx == h+1){
            ans = false;
        }
    }
    REP(i,n){
        if(s[i] == 'L'){
            tmpy--;
        }
        if(tmpy == 0){
            ans = false;
        }
        if(t[i] == 'R' && tmpy < w){
            tmpy++;
        }
        if(tmpy == 0){
            ans = false;
        }
    }
    tmpy = sc;
    REP(i,n){
        if(s[i] == 'R'){
            tmpy++;
        }
        if(tmpy == w+1){
            ans = false;
        }
        if(t[i] == 'L' && tmpy > 1){
            tmpy--;
        }
        if(tmpy == w+1){
            ans = false;
        }

    }
    (ans)? cout << "YES" : cout << "NO";


    return 0;
}

void Debug(auto a){
    cout << "{ ";
    for(auto b: a){
        cout << b << " ";
    }
    cout << "}" << endl;
}
int nibul(auto a,auto b){
    int x = lower_bound(All(a),b) - a.begin();
    //key以上の初めてのitr
    return x;
}
int nibuu(auto a,auto b){
    int x = upper_bound(All(a),b) - a.begin();
    //key以下の最後のitr
    return x-1;
}


Measured memory_bytes: 776