#include <bits/stdc++.h>

using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define FORR(i, a, b) for(int i = (a); i > (b); --i)
#define REP(i, n) for(int i = 0; i < (n); ++i)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECCIN(x)                                                              \
    for(auto &youso_ : (x)) cin >> youso_
#define mp make_pair
#define bitcnt __builtin_popcount
#define All(a) (a).begin(), (a).end()
template <typename T = long long> inline T IN() {
    T x;
    cin >> x;
    return (x);
}
inline void CIN() {}
template <class Head, class... Tail>
inline void CIN(Head &&head, Tail &&... tail) {
    cin >> head;
    CIN(move(tail)...);
}
#define CINT(...)                                                              \
    int __VA_ARGS__;                                                           \
    CIN(__VA_ARGS__)
#define LCIN(...)                                                              \
    ll __VA_ARGS__;                                                            \
    CIN(__VA_ARGS__)
#define SCIN(...)                                                              \
    string __VA_ARGS__;                                                        \
    CIN(__VA_ARGS__)
#define Yes(a) cout << (a ? "Yes" : "No") << "\n"
#define YES(a) cout << (a ? "YES" : "NO") << "\n"

typedef long long ll;
typedef unsigned long long ul;
typedef vector<int> V;
typedef vector<ll> VL;
typedef pair<int, int> Pair;
typedef pair<ll, ll> PL;
typedef priority_queue<int> PQ;
typedef priority_queue<int, V, greater<int>> PQG;

const int INF = 1e9;
const int MOD = 1e9 + 7;
// const int MOD = 998244353;
const ll LINF = 1e18;
int H, W, N, sr, sc;
string S, T;
map<char, int> ssum, tsum;

int main() {
    cin >> H >> W >> N >> sr >> sc >> S >> T;
    int r = sr - 1, c = sc - 1;
    REP(i, N) {
        ssum[S[i]]++;
        if(c + ssum['R'] >= W && S[i] == 'R') {
            if(tsum['L'] > 0) {
                tsum['L']--;
                ssum['R']--;
            } else {
                cout << "NO"
                     << "\n";
                return 0;
            }
        }
        if(c - ssum['L'] < 0 && S[i] == 'L') {
            if(tsum['R'] > 0) {
                tsum['R']--;
                ssum['L']--;
            } else {
                cout << "NO"
                     << "\n";
                return 0;
            }
        }
        if(r - ssum['U'] < 0 && S[i] == 'U') {
            if(tsum['D'] > 0) {
                tsum['D']--;
                ssum['U']--;
            } else {
                cout << "NO"
                     << "\n";
                return 0;
            }
        }
        if(r + ssum['D'] >= H && S[i] == 'D') {
            if(tsum['U'] > 0) {
                tsum['U']--;
                ssum['D']--;
            } else {
                cout << "NO"
                     << "\n";
                return 0;
            }
        }
        tsum[T[i]]++;
        if(c + ssum['R'] < tsum['L'] && T[i] == 'L') tsum['L']--;
        if(W - 1 - c + ssum['L'] < tsum['R'] && T[i] == 'R') tsum['R']--;
        if(r + ssum['D'] < tsum['U'] && T[i] == 'U') tsum['U']--;
        if(H - 1 - r + ssum['U'] < tsum['D'] && T[i] == 'D') tsum['D']--;
    }
    cout << "YES"
         << "\n";
    return 0;
}


Measured memory_bytes: 776