#pragma GCC optimize ("O3")
#pragma GCC target ("tune=native")
#pragma GCC target ("avx")

#include <bits/stdc++.h>

// 汎用マクロ
#define ALL_OF(x) (x).begin(), (x).end()
#define REP(i,n) for (long long i=0, i##_len=(n); i<i##_len; i++)
#define RANGE(i,is,ie) for (long long i=(is), i##_end=(ie); i<=i##_end; i++)
#define DSRNG(i,is,ie) for (long long i=(is), i##_end=(ie); i>=i##_end; i--)
#define UNIQUE(v) { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); }
template<class T> bool chmax(T &a, const T &b) {if (a < b) {a = b; return 1;} return 0; }
template<class T> bool chmin(T &a, const T &b) {if (a > b) {a = b; return 1;} return 0; }
#define INF 0x7FFFFFFF
#define LINF 0x7FFFFFFFFFFFFFFFLL
#define Yes(q) (q ? "Yes" : "No")
#define YES(q) (q ? "YES" : "NO")
#define DUMP(q) cerr << "[DEBUG] " #q ": " << (q) << " at " __FILE__ ":" << __LINE__ << endl
#define DUMPALL(q) { cerr << "[DEBUG] " #q ": ["; REP(dumpall_i, (q).size()) { cerr << q[dumpall_i] << (dumpall_i == (q).size() - 1 ? "" : ", "); } cerr << "] at " __FILE__ ":" << __LINE__ << endl; }

// gcc拡張マクロ
#define gcd __gcd
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll

// エイリアス
using  ll = long long;
using ull = unsigned long long;
using  ld = long double;
using namespace std;

// モジュール


// 処理内容
int main() {
    
    ll h, w, n; cin >> h >> w >> n;
    ll sr, sc; cin >> sr >> sc;
    string s, t; cin >> s >> t;

    sr--; sc--; // 0-indexed

    bool ans = true; // whether Aoki wins
    
    // Takahashi tries to go left to fall
    if (ans) {
        ll si = sr, sj = sc;
        REP(i, n) {
            if (s[i] == 'L') {
                sj--;
            }
            if (sj < 0) {
                ans = false;
                break; // Takahashi wins
            }
            if (t[i] == 'R') {
                if (sj < w-1) {
                    sj++;
                }
            }
            if (i == n-1) {
                break; // Aoki wins
            }
        }
    }
    
    // Takahashi tries to go right to fall
    if (ans) {
        ll si = sr, sj = sc;
        REP(i, n) {
            if (s[i] == 'R') {
                sj++;
            }
            if (sj >= w) {
                ans = false;
                break; // Takahashi wins
            }
            if (t[i] == 'L') {
                if (sj > 0) {
                    sj--;
                }
            }
            if (i == n-1) {
                break; // Aoki wins
            }
        }
    }
    
    // Takahashi tries to go upward to fall
    if (ans) {
        ll si = sr, sj = sc;
        REP(i, n) {
            if (s[i] == 'U') {
                si--;
            }
            if (si < 0) {
                ans = false;
                break; // Takahashi wins
            }
            if (t[i] == 'D') {
                if (si < h-1) {
                    si++;
                }
            }
            if (i == n-1) {
                break; // Aoki wins
            }
        }
    }
    
    // Takahashi tries to go upward to fall
    if (ans) {
        ll si = sr, sj = sc;
        REP(i, n) {
            if (s[i] == 'D') {
                si++;
            }
            if (si >= h) {
                ans = false;
                break; // Takahashi wins
            }
            if (t[i] == 'U') {
                if (si > 0) {
                    si--;
                }
            }
            if (i == n-1) {
                break; // Aoki wins
            }
        }
    }
    
    cout << YES(ans) << endl;
    
}

Measured memory_bytes: 776