#include <stdio.h>
#include <algorithm>
#include <deque>
#include <tuple>
using namespace std;
using ll = long long;

int h, w, n, sr, sc;
char s[200010], t[200010];
int main() {
	scanf("%d %d %d", &h, &w, &n);
	scanf("%d %d", &sr, &sc);
	scanf("%s", s);
	scanf("%s", t);

	int u = sr, d = sr, l = sc, r = sc;
	for (int i = 0; i < n; i++) {
		if (s[i] == 'U')
			u--;
		else if (s[i] == 'D')
			d++;
		else if (s[i] == 'L')
			l--;
		else if (s[i] == 'R')
			r++;

		if (u < 1 || h < d || l < 1 || w < r) {
			printf("NO\n");
			return 0;
		}

		if (t[i] == 'U')
			d = max(1, d - 1);
		else if (t[i] == 'D')
			u = min(h, u + 1);
		else if (t[i] == 'L')
			r = max(1, r - 1);
		else if (t[i] == 'R')
			l = min(w, l + 1);
	}
	printf("YES\n");
}