#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <time.h>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#define rep(i,s,n) for(int i = (s); (n) > i; i++)
#define REP(i,n) rep(i,0,n)
#define RANGE(x,a,b) (min(a,b) <= (x) && (x) <= max(a,b)) //hei
#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))
#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))
#define PW(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MODU 998244353LL
#define bitcheck(a,b)   ((a >> b) & 1)
#define bitset(a,b)      ( a |= (1 << b))
#define bitunset(a,b)    (a &= ~(1 << b))
#define MP(a,b) make_pair((a),(b))
#define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second))
#define pritnf printf
#define scnaf scanf
#define itn int
#define PI 3.141592653589


#define izryt bool
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T &val) {
	std::fill((T*)array, (T*)(array + N), val);
}
pll Dir[4] = {
	{ -1 ,0 },{ 0 , 1 },{ 1 ,0 },{ 0 ,-1 }
};

//[a, b)
#define Getsum(ar, a,b) (ar[b] - ar[a])
#define INF 10000000000000000LL
#define chmax(a,b) a = max(a,b)
#define chmin(a,b) a = min(a,b)

struct Edge {
	int from, to;
	ll w;
	bool operator<(const Edge& rhs) const {
		return MP(w, MP(from, to)) < MP(rhs.w, MP(rhs.from, rhs.to));
	}
};
ll mod_pow(ll x, ll n, ll mod) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x %mod;
		x = x * x%mod;
		n >>= 1;
	}
	return res;
}
typedef vector<vector<Edge>> Graph;


bool solve(int r, int sp, vector<pii> c) {
	sp--;
	pii inter = { 0, r - 1 };

	REP(i, c.size()) {
		if (c[i].first == 0) {
			inter.first = max(inter.first, inter.first - c[i].second);
			inter.second = min(inter.second, inter.second - c[i].second);
		}
		else {
			inter = MP(min(inter.first, inter.first - c[i].second), max(inter.second, inter.second - c[i].second));
		}

		if (inter.second < inter.first) {
			return 1;
		}
		inter.first = max(0, inter.first);
		inter.second = min(r - 1, inter.second);
	}

	if (inter.first <= sp && inter.second >= sp) {
		return 0;
	}
	else
	{
		return 1;
	}
}

signed main(void) {
	int h, w, n;
	cin >> h >> w >> n;

	int sr, sc;
	cin >> sr >> sc;

	string s, t;
	cin >> s >> t;
	vector<pii> hc, wc;

	REP(i, n) {
		if (s[i] == 'U') {
			hc.push_back({ 0,-1 });
		}
		if (s[i] == 'D') {
			hc.push_back({ 0,1 });
		}
		if (s[i] == 'R') {
			wc.push_back({ 0,1 });
		}
		if (s[i] == 'L') {
			wc.push_back({ 0,-1 });
		}
		if (t[i] == 'U') {
			hc.push_back({ 1,-1 });
		}
		if (t[i] == 'D') {
			hc.push_back({ 1,1 });
		}
		if (t[i] == 'L') {
			wc.push_back({ 1,-1 });
		}
		if (t[i] == 'R') {
			wc.push_back({ 1,1 });
		}

	}

	reverse(ALL(hc));

	reverse(ALL(wc));

	int ans = 0;
	ans |= solve(h, sr, hc);
	ans |= solve(w, sc, wc);

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

	return 0;
}


Measured memory_bytes: 6508