#include <bits/stdc++.h>

#define debug(x) cout <<"DEBUG"<<" "<< #x << ":" << x << '\n'
#define rep(i,n) for(int_fast32_t i = 0; i < ((int_fast32_t)(n)); i++)   // 0-indexed昇順
#define rep1(i,n) for(int_fast32_t i = 1; i <= ((int_fast32_t)(n)); i++) // 1-indexed昇順
#define rrep(i,n) for(int_fast32_t i = ((int_fast32_t)(n)-1); i >= 0; i--)  // 0-indexed降順
#define rrep1(i,n) for(int_fast32_t i = ((int_fast32_t)(n)); i >= 1; i--)   // 1-indexed降順
#define all(x) (x).begin(),(x).end()

using namespace std;

template<typename T>
using vec = vector<T>;
using i32 = int_fast32_t;
using i64 = int_fast64_t;
using u32 = uint_fast32_t;
using u64 = uint_fast64_t;
using ll = long long;
using ld = long double;
using vi = vec<int_fast32_t>;
using vl = vec<int_fast64_t>;
using vld = vec<ld>;
using vii = vec<vi>;  // 2次元配列
using PII = pair<int_fast32_t, int_fast32_t>;

template<class T>
using maxheap = std::priority_queue<T>;
template<class T>
using minheap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template<class T,class U> inline bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U> inline bool chmin(T &a, const U &b){if(a>b){a=b;return 1;}return 0;}

const ld Pi = std::acos(-1.0L);
constexpr ll infll = (1LL<<62)-1;
constexpr int inf = (1<<30)-1;
const int mod = 1000000007;
// const int mod = 998244353;

i32 h,w, n, sr,sc, tmp_pnt;
string s,t;
bool outOfGrid;
/*FUNCs=================================================*/


/*MAIN==================================================*/
signed main(){
    int START_TIME = clock();
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化
//    cout << fixed << setprecision(15);

    cin >> h >> w >> n >> sr >> sc;
    cin >> s >> t;

    /**
     * 目的となる方向に迷わず一方向へ向かうのと、どこか別の方向に進みながら向かうのでは到達時刻が変わらない。
     * よって、各方向に向かう場合それぞれについて貪欲に考えればよい
     */

    vi csumL(w+1), csumR(w+1), csumU(h+1), csumD(h+1);
    rep(i,w) {
        csumL[i+1] = csumL[i] + (s[i] == 'L' ? 1 : 0);
        csumR[i+1] = csumR[i] + (s[i] == 'R' ? 1 : 0);
    }
    rep(i,h) {
        csumU[i+1] = csumU[i] + (s[i] == 'U' ? 1 : 0);
        csumD[i+1] = csumD[i] + (s[i] == 'D' ? 1 : 0);
    }

    // go to L
    tmp_pnt = sc;
    rep(i,n) {
        if(s[i] == 'L') --tmp_pnt;
        if(tmp_pnt <= 0) {
            outOfGrid = 1;
            break;
        }
        if(t[i] == 'R' && tmp_pnt+csumR[w]-csumR[tmp_pnt-1]+1 <= w) ++tmp_pnt;
        chmin(tmp_pnt, w);
    }

    // go to R
    tmp_pnt = sc;
    rep(i,n) {
        if(s[i] == 'R') ++tmp_pnt;
        if(tmp_pnt > w) {
            outOfGrid = 1;
            break;
        }
        if(t[i] == 'L' && tmp_pnt-(csumL[tmp_pnt]-csumL[0])-1 > 0) --tmp_pnt;
        chmax(tmp_pnt, 0);
    }

    // go to U
    tmp_pnt = sr;
    rep(i,n) {
        if(s[i] == 'U') --tmp_pnt;
        if(tmp_pnt <= 0) {
            outOfGrid = 1;
            break;
        }
        if(t[i] == 'D' && tmp_pnt+csumD[h]-csumD[tmp_pnt-1]+1 <= h) ++tmp_pnt;
        chmin(tmp_pnt, h);
    }

    // go to D
    tmp_pnt = sr;
    rep(i,n) {
        if(s[i] == 'D') ++tmp_pnt;
        if(tmp_pnt > h) {
            outOfGrid = 1;
            break;
        }
        if(t[i] == 'U' && tmp_pnt-(csumU[tmp_pnt]-csumU[0])-1 > 0) --tmp_pnt;
        chmax(tmp_pnt, 0);
    }

    if(outOfGrid) cout << "NO" << '\n';
    else cout << "YES" << '\n';

    // printf("ExecutionTime: %d /ms\n",1000*(int)((clock()-START_TIME)/CLOCKS_PER_SEC));
}


Measured memory_bytes: 7192