#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
 
 
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	int H, W, N, sr, sc;
	cin >> H >> W >> N >> sr >> sc;
	string S, T;
	cin >> S >> T;
	int l = sc, r = sc, u = sr, d = sr;
	bool ans = true;
	for (int i = 0; i < N; ++i) {
		switch (S[i])
		{
		case 'L':
			--l;
			if (l < 1) ans = false;
			break;
		case 'R':
			++r;
			if (r > W) ans = false;
			break;
		case 'U':
			--d;
			if (d < 1) ans = false;
			break;
		case 'D':
			++u;
			if (u > H) ans = false;
			break;
		}
		if (!ans) break;

		switch (T[i]) {
		case 'L':
			if (r > 1)	--r;
			break;
		case 'R':
			if (l < W)++l;
			break;
		case 'U':
			if (u > 1)--u;
			break;
		case 'D':
			if (d < H)++d;
			break;
		}
	}
	cout << (ans ? "YES" : "NO") << endl;
}