#include <bits/stdc++.h>
#define l_ength size
const int inf = (1<<30);
const int mod = 1000000007;	// 998244353
using ll = long long;
using namespace std;

int main(){
	int h, w, n, sr, sc; cin >> h >> w >> n >> sr >> sc;
	--sr; --sc;
	int l = 0, r = w, u = 0, d = h;
	string s, t; cin >> s >> t;
	for( int i = n-1; i >= 0; --i ){
		// Aoki
		if( t[i] == 'L' ) r = min(w, r+1);
		if( t[i] == 'R' ) l = max(0, l-1);
		if( t[i] == 'U' ) d = min(h, d+1);
		if( t[i] == 'D' ) u = max(0, u-1);
		// Takahaschi
		if( s[i] == 'L' ) l = min(w, l+1);
		if( s[i] == 'R' ) r = max(0, r-1);
		if( s[i] == 'U' ) u = min(h, u+1);
		if( s[i] == 'D' ) d = max(0, d-1);
		if( l == r or u == d ){
			cout << "NO" << endl;
			return 0;
		}
	}
	if( u <= sr and sr < d and l <= sc and sc < r ) cout << "YES" << endl;
	else cout << "NO" << endl;
}