// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;

// UDLR
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, -1, 1};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;

string pat = "UDLR";
vector< vector<int> > dir = { {0, 1}, {2, 3} };
int H, W, N, sr, sc;
using Vector2D = vector< vector<int> >;
int solve(const Vector2D &cnt1, const Vector2D &cnt2, int mode) {
    int mar_l = (!mode ? sr : sc);
    int mar_r = (!mode ? H - sr - 1 : W - sc - 1);
    

    // どちら側に寄せたいのか？
    int target[] = {mar_l, mar_r};
    for(int k=0; k<2; k++) {
        int sum = 0;
        for(int i=0; i<N; i++) {
            // cnt1 は取り除きたい (0)
            // cnt2 はとどめておきたい (1)

            int c0 = cnt1[i+1][ dir[mode][k    ] ] - cnt1[i][ dir[mode][k    ] ];        
            int c1 = cnt2[i+1][ dir[mode][1 - k] ] - cnt2[i][ dir[mode][1 - k] ];

            // fprintf(stderr, "# i = %lld, dir = %c, mar = %lld, sum = %lld\n",
            //        i, pat[ dir[mode][k] ], target[k], sum);


            if(sum + c0 > target[k]) {
                fprintf(stderr, "# takahashi won 1: i = %lld, dir = %c\n", i, pat[ dir[mode][k] ]);
                return 0;
            }
            
            
            int fut0 = cnt1[N][ dir[mode][k    ] ] - cnt1[i][ dir[mode][k    ] ];
            int fut1 = cnt2[N][ dir[mode][1 - k] ] - cnt2[i][ dir[mode][1 - k] ];

            // fprintf(stderr, "i = %lld, c0 = %lld, c1 = %lld, fut0 = %lld, fut1 = %lld\n", i, c0, c1, fut0, fut1);

            /*
            if(sum + fut0 - fut1 > target[k]) {
                fprintf(stderr, "# takahashi won 2: i = %lld, dir = %c\n", i, pat[ dir[mode][k] ]);
                return 0;
            }
            */
            
            sum += c0;
            sum -= c1;
            sum = max(sum, -target[1 - k]);
        }
    }
    return 1;
}
 
signed main() {
    cin >> H >> W >> N;
    cin >> sr >> sc;
    sr--; sc--;

    string s, t; cin >> s >> t;

    vector< vector<int> > cnt1(N+1, vector<int>(4)),
        cnt2(N+1, vector<int>(4));
    for(int i=0; i<N; i++) {
        {
            int c = pat.find(s[i]);
            for(int k=0; k<4; k++) {
                cnt1[i+1][k] += cnt1[i][k] + (k == c);
            }
        }

        {
            int c = pat.find(t[i]);
            for(int k=0; k<4; k++) {
                cnt2[i+1][k] += cnt2[i][k] + (k == c);
            }
        }
    }

    // turn, win player
    auto ans1 = solve(cnt1, cnt2, 0);
    auto ans2 = solve(cnt1, cnt2, 1);
    auto ans = min(ans1, ans2);

    // 残っているほうが状態としては弱い
    cout << (ans == 1 ? "YES" : "NO") << endl;
    return 0;
}


Measured memory_bytes: 28808