#include <bits/stdc++.h>
using namespace std;
int h, w, n, s1, s2;
bool check(int dr, int dl, int du, int dd) {
	if (dr<0)
		return false;
	if (dl<0)
		return false;
	if (du<0)
		return false;
	if (dd<0)
		return false;
	return true;
}

int main() {
	cin >> h >> w >> n >> s1 >> s2;
	string s, t;
	cin >> s >> t;
	int dr = w-s2, dl =s2-1, du =s1-1 , dd = h-s1;
	for (int i = 0;i < n;i++) {
		if (s[i] == 'L')
			dl--;
		if (s[i] == 'R')
			dr--;
		if (s[i] == 'U')
			du--;
		if (s[i] == 'D')
			dd--;
		if (!check(dr, dl, du, dd)) {
			cout << "NO" << endl;
			return 0;
		}
		if (t[i] == 'L'&&dr<w-1)
			dr++;
		if (t[i] == 'R'&&dl<w-1)
			dl++;
		if (t[i] == 'U'&&dd<h-1)
			dd++;
		if (t[i] == 'D'&&du<h-1)
			du++;
	}
	cout << "YES" << endl;
}