#include <bits/stdc++.h>

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int h, w, n;
	cin >> h >> w >> n;

	int sr, sc;
	cin >> sr >> sc;

	string s, t;
	cin >> s >> t;

	int l = 1;
	int r = w;

	int u = 1;
	int d = h;

	bool off = false;
	for(int i = n-1; i >= 0; i--) {
		if(t[i] == 'L') {
			r = min(w, r+1);
		}
		if(t[i] == 'R') {
			l = max(1, l-1);
		}
		if(t[i] == 'U') {
			d = min(h, d+1);
		}
		if(t[i] == 'D') {
			u = max(1, u-1);
		}

		if(s[i] == 'L') {
			l++;
		}
		if(s[i] == 'R') {
			r--;
		}
		if(s[i] == 'U') {
			u++;
		}
		if(s[i] == 'D') {
			d--;
		}

		if(l > r) {
			off = true;
		}
		if(u > d) {
			off = true;
		}
	}

	if(sc < l || sc > r) {
		off = true;
	}
	if(sr < u || sr > d) {
		off = true;
	}

	cout << (off ? "NO" : "YES") << endl;

	return 0;
}
