#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main() {
	int H, W, N, sr, sc;
	cin >> H >> W >> N >> sr >> sc;
	string s, t;
	cin >> s >> t;

	bool ok = true;
	int l = 1, r = W;
	int u = 1, d = H;
	for (int i = N - 1; i >= 0; --i) {
		if (t[i] == 'R') { l = max(1, l - 1); }
		if (t[i] == 'L') { r = min(W, r + 1); }
		if (t[i] == 'D') { u = max(1, u - 1); }
		if (t[i] == 'U') { d = min(H, d + 1); }

		if (s[i] == 'R') { r -= 1; }
		if (s[i] == 'L') { l += 1; }
		if (s[i] == 'D') { d -= 1; }
		if (s[i] == 'U') { u += 1; }
		
		ok = ok && (l <= r);
		ok = ok && (u <= d);
	}
	ok = ok && ((l <= sc) && (sc <= r)) && ((u <= sr) && (sr <= d));

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

	return 0;
}
