#include <bits/stdc++.h>

#ifdef DEBUG
#define PRINT(x)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#x<<" = "<<(x)<<endl;
#define PRINTA(a,first,last)\
    cout<<"func "<<__func__<<": line "<<__LINE__<<": "<<#a<<"["<<(first)<<", "<<(last)<<")"<<endl;\
    for (int i=(first);i<(last);++i){cout<<#a<<"["<<i<<"] = "<<(a)[i]<<endl;}
#else
#define PRINT(x)
#define PRINTA(a,first,last)
#endif

#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);--i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define RREP(i,n) for (int i=(n)-1;i>=0;--i)
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007

using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

template <class T, class U> void amax(T& x, U y) {if (x < y) x = y;}
template <class T, class U> void amin(T& x, U y) {if (x > y) x = y;}

int H, W, N, sr, sc;
string S, T;
int SL, SR, SU, SD, TL, TR, TU, TD;

bool out_range(int x, int y) {
    return x < 0 || x >= H || y < 0 || y >= W;
}

void pri(int x, int y) {
    //printf("(x, y) = (%d, %d)\n", x, y);
}

bool can_remove() {
    int x, y;

    // Takahashi Left Up
    PRINT("Takahashi Left Up principle");
    x = sr;
    y = sc;
    REP(i, N) {
        if (S[i] == 'L') {
            PRINT("Takahashi L");
            y--;
        } else if (S[i] == 'U') {
            PRINT("Takahashi U");
            x--;
        } else {
            PRINT("Takahashi pass");
        }
        pri(x, y);
        if (out_range(x, y)) {
            PRINT("remove from Left Up");
            return true;
        }
        if (T[i] == 'R' && y + 1 < W) {
            PRINT("Aoki R");
            y++;
        } else if (T[i] == 'D' && x + 1 < H) {
            PRINT("Aoki D");
            x++;
        } else {
            PRINT("Aoki pass");
        }
    }

    // Takahashi Right Down
    PRINT("Takahashi Right Down principle");
    x = sr;
    y = sc;
    REP(i, N) {
        if (S[i] == 'R') {
            y++;
            PRINT("Takahashi R");
        } else if (S[i] == 'D') {
            x++;
            PRINT("Takahashi D");
        } else {
            PRINT("Takahashi pass");
        }
        pri(x, y);
        if (out_range(x, y)) {
            PRINT("remove from Right Down");
            return true;
        }
        if (T[i] == 'L' && y - 1 >= 0) {
            PRINT("Aoki L");
            y--;
        } else if (T[i] == 'U' && x - 1 >= 0) {
            PRINT("Aoki U");
            x--;
        } else {
            PRINT("Aoki pass");
        }
        pri(x, y);
    }

    // Takahashi Left Down
    x = sr;
    y = sc;
    REP(i, N) {
        if (S[i] == 'L') {
            y--;
        } else if (S[i] == 'D') {
            x++;
        }
        if (out_range(x, y)) {
            PRINT("remove from Left Down");
            return true;
        }
        if (T[i] == 'R' && y + 1 < W) {
            y++;
        } else if (T[i] == 'U' && x - 1 >= 0) {
            x--;
        }
    }

    // Takahashi Right Up
    x = sr;
    y = sc;
    REP(i, N) {
        if (S[i] == 'R') {
            y++;
        } else if (S[i] == 'U') {
            x--;
        }
        if (out_range(x, y)) {
            PRINT("remove from Right Up");
            return true;
        }
        if (T[i] == 'L' && y - 1 >= 0) {
            y--;
        } else if (T[i] == 'D' && x + 1 < H) {
            x++;
        }
    }

    return false;
}

int main(void) {
    cin.tie(0);
    ios::sync_with_stdio(false);

    cin >> H >> W >> N >> sr >> sc >> S >> T;
    sr--;
    sc--;

    SL = count(all(S), 'L');
    SR = count(all(S), 'R');
    SU = count(all(S), 'U');
    SD = count(all(S), 'D');
    TL = count(all(T), 'L');
    TR = count(all(T), 'R');
    TU = count(all(T), 'U');
    TD = count(all(T), 'D');

    if (can_remove()) {
        cout << "NO" << endl;
    } else {
        cout << "YES" << endl;
    }

    return 0;
}



Measured memory_bytes: 920