#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> Pll;
typedef pair<P,P> PP;
#define rep(i,a,n) for(int i = a;i < n;i++)
#define repr(i,a,n) for(int i = n-1;i >= a;i--)
#define ALL(v) v.begin(), v.end()
#define LINF (ll)1e17
#define INF (int)1e9
#define MOD (ll)1e9+7
#define sMOD 1e5
#define fs first
#define sc second

ll gcd(ll a,ll b){
	if(!b) return a;
	return gcd(b,a%b);
}

void YNout(bool check){
	if(check)cout << "Yes" << endl;
	else cout << "No" << endl;
	
	return;
}

void Yayout(bool check){
	if(check) cout << "Yay!" << endl;
	else cout << ":(" << endl;
	
	return;
}
/*
template <typename T>
void vecout(vector<T>& vecout_vec){
	
	rep(i,0,vecout_vec.size()){
		cout << vecout_vec.at(i) << endl;
	}
	
	return ;
}

template <typename T>
void vecin(vector<T>& vecin_vec, ll n){
	
	ll temp ;
	
	rep(i,0,n){
		cin >> temp;
		vecin_vec.push_back(temp);
		
	}
}

template <typename T>
void in(T& literal_in, T& literal_in2, ...){
	cin >> literal_in;
	in(literal_in2, ...);
	
	return;
}

template <typename T>
void in(T& literal_in){
	
	cin >> literal_in;
	
	return;
}

template <typename T>
void out(T& literal_out, T& literal_out2, ...){
	cout << literal_out << endl;
	out(literal_out2, ...);
	
	return;
}

template <typename T>
void out(T& literal_out){
	
	cout << literal_out << endl;
	
	return;
}
*/
signed main(){
	ll h,w,n;
	ll x,y;
	string s,t;
	cin >> h >> w >> n;
	cin >> y >> x;
	cin >> s >> t;
	
	ll d[4] = {y,h-y+1,w-x+1,x};
	
	//cout << d[0] << " " << d[1] << " " << d[2] << " " << d[3] << endl;
	
	ll ruiseki_A[4][n];
	ll ruiseki_B[4][n];
	
	rep(i,0,n){
		
		if(i > 0){
			rep(j,0,4){
				ruiseki_A[j][i] = ruiseki_A[j][i-1];
				ruiseki_B[j][i] = ruiseki_B[j][i-1];
			}
		}
		else if(i == 0){
			rep(j,0,4){
				ruiseki_A[j][i] = 0;
				ruiseki_B[j][i] = 0;
			}
		}
		
		
		if(s[i] == 'U')ruiseki_A[0][i]++;
		if(s[i] == 'D')ruiseki_A[1][i]++;
		if(s[i] == 'R')ruiseki_A[2][i]++;
		if(s[i] == 'L')ruiseki_A[3][i]++;
		
		if(t[i] == 'U'){
			if(ruiseki_B[1][i]+1 - ruiseki_A[1][i] < d[0] ) ruiseki_B[1][i]++;
		}
		if(t[i] == 'D'){
			if(ruiseki_B[0][i]+1 - ruiseki_A[0][i] < d[1] ) ruiseki_B[0][i]++;
		}
		if(t[i] == 'R'){
			if(ruiseki_B[3][i]+1 - ruiseki_A[3][i] < d[2] ){
				ruiseki_B[3][i]++;
				//cout << ruiseki_B[3][i] << endl;
			}
		}
		if(t[i] == 'L'){
			//cout << ruiseki_B[2][i]+1 << " " << ruiseki_A[2][i] << " " << d[2] << " " << ( ruiseki_B[2][i]+1 - ruiseki_A[2][i] < d[2]) << endl;
			if(ruiseki_B[2][i]+1 - ruiseki_A[2][i] < d[3] ) {
				ruiseki_B[2][i]++;
				//cout << ruiseki_B[2][i] << endl;
			}
			
		}
		
		//cout << ruiseki_B[1][i]+1 - ruiseki_A[0][i] << " " << d[1] << endl;
		//cout << ruiseki_B[0][i]+1 - ruiseki_A[1][i] << " " << d[0]  << endl;
		//cout << ruiseki_B[3][i]+1 - ruiseki_A[2][i] << " " << d[3] << " " << ( ruiseki_B[3][i]+1 - ruiseki_A[2][i] < d[3]) << endl;
		//cout << ruiseki_B[2][i]+1 - ruiseki_A[3][i] << " " << d[2] << endl;
		
		
	}
	
	/*
	rep(i,0,4){
		rep(j,0,n)cout << ruiseki_A[i][j];
		cout << endl;
	}
	rep(i,0,4){
		rep(j,0,n)cout << ruiseki_B[i][j];
		cout << endl;
	}
	*/
	
	
	rep(i,0,n){
		rep(j,0,4){
			
			if(i == 0){
				//cout << ruiseki_A[j][i] << " " << -1 << "  ";
				if(ruiseki_A[j][i] >= d[j]){
					//cout << i << endl;
					cout << "NO" << endl;
					return 0;
				}
			}
			else if(ruiseki_A[j][i] - ruiseki_B[j][i-1] >= d[j]){
				//cout << i << " " << j<< endl;
				//cout << ruiseki_A[j][i] << " " << ruiseki_B[j][i-1]+1  << " " << d[j] << endl;
				cout << "NO" << endl;
				return 0;
			}
			
			//if(i != 0) cout << ruiseki_A[j][i] << " " << ruiseki_A[j][i-1] << "  ";
		}
		//cout << endl;
	}
	
	cout << "YES" << endl;
	
	
	return 0;
}


Measured memory_bytes: 13320