#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef double ld;
typedef complex<ld> Point;
const ll INF = mod * mod;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second

struct SegT {
private:
	int sz; vector<int> node;
	const int init_c = -mod;
public:
	SegT(int n) {
		sz = 1;
		while (sz < n)sz *= 2;
		node.resize(2 * sz - 1, init_c);
	}
	int f(int a, int b) {
		return max(a, b);
	}
	void update(int k, int a) {
		k += sz - 1;
		node[k] = a;
		while (k > 0) {
			k = (k - 1) / 2;
			node[k] = f(node[k * 2 + 1], node[k * 2 + 2]);
		}
	}
	int query(int a, int b, int k = 0, int l = 0, int r = -1) {
		if (r < 0)r = sz;
		if (r <= a || b <= l)return init_c;
		else if (a <= l && r <= b)return node[k];
		else {
			int vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
			int vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
			return f(vl, vr);
		}
	}
};
int h, w, n;
int ru[1 << 19];
int rl[1 << 19];

void solve() {
	cin >> h >> w >> n;
	int x, y; cin >> x >> y;
	string s, t; cin >> s >> t;
	SegT up(2 * n + 1); up.update(0, 0);
	rep(i, n) {
		ru[2 * i + 1] = ru[2 * i];
		if (s[i] == 'U') {
			ru[2 * i + 1]++;
		}
		ru[2 * i + 2] = ru[2 * i + 1];
		if (t[i] == 'D') {
			ru[2 * i + 2]--;
		}
		up.update(2 * i + 1, ru[2 * i + 1]);
		up.update(2 * i + 2, ru[2 * i + 2]);
	}
	int z = up.query(0, 2 * n + 1);
	if (z >= x) {
		cout << "NO" << endl; return;
	}
	rep(i, n) {
		if (s[i] == 'D')x++;
		if (x > h) {
			cout << "NO" << endl; return;
		}
		int ma = up.query(2 * i + 2, 2 * n + 1);
		int cur = ru[2 * i + 2];
		ma -= cur;
		if (ma >= x) {
			if (ma == x && t[i] == 'D') {
				x++;
				if (x > h) {
					cout << "NO" << endl; return;
				}
			}
			else {
				cout << "NO" << endl; return;
			}
		}
		else if (ma < x - 1 && t[i] == 'U')x--;
	}
	SegT le(2 * n + 1); le.update(0, 0);
	rep(i, n) {
		rl[2 * i + 1] = rl[2 * i];
		if (s[i] == 'L') {
			rl[2 * i + 1]++;
		}
		rl[2 * i + 2] = rl[2 * i + 1];
		if (t[i] == 'R') {
			rl[2 * i + 2]--;
		}
		le.update(2 * i + 1, rl[2 * i + 1]);
		le.update(2 * i + 2, rl[2 * i + 2]);
	}
	z = le.query(0, 2 * n + 1);
	if (z >= y) {
		cout << "NO" << endl; return;
	}
	rep(i, n) {
		if (s[i] == 'R')y++;
		if (y > w) {
			cout << "NO" << endl; return;
		}
		int ma = le.query(2 * i + 2, 2 * n + 1);
		int cur = rl[2 * i + 2];
		ma -= cur;
		if (ma >= y) {
			if (ma == y && t[i] == 'R') {
				y++;
				if (y > w) {
					cout << "NO" << endl; return;
				}
			}
			else {
				cout << "NO" << endl; return;
			}
		}
		else if (ma < y - 1 && t[i] == 'L') {
			y--;
		}
	}
	cout << "YES" << endl;
}
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	//stop
	return 0;
}


Measured memory_bytes: 12696