#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MAX_N 200001


int main(){	
	long long W;
	long long s_r;
	long long s_c;
	long long H;
	string T;
	string S;
	long long N;
	scanf("%lld",&H);
	scanf("%lld",&W);
	scanf("%lld",&N);
	scanf("%lld",&s_r);
	scanf("%lld",&s_c);
	cin >> S;
	cin >> T;
	
	ll l=0, r=W, u=0, d=H;
	for (int i = N-1; i >= 0; i--) {
		if (T[i] == 'R' && l != 0) l--;
		if (T[i] == 'L' && r != W) r++;
		if (T[i] == 'D' && u != 0) u--;
		if (T[i] == 'U' && d != H) d++;
		if (S[i] == 'L' ) l++;
		if (S[i] == 'R' ) r--;
		if (S[i] == 'U' ) u++;
		if (S[i] == 'D' ) d--;
		if (l == W || r == 0 || u == H || d == 0) {
			cout << "NO" << endl;
			return 0;
		}
	}

	if (u < s_r && s_r <= d && l < s_c && s_c <= r) cout << "YES" << endl; else cout << "NO" << endl;

	return 0;
}

