#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <queue>
 
typedef char                SINT8;
typedef unsigned char       UINT8;
typedef short               SINT16;
typedef unsigned short      UINT16;
typedef int                 SINT32;
typedef unsigned int        UINT32;
typedef long long           SINT64;
typedef unsigned long long  UINT64;
typedef double              DOUBLE;
 
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
#define rep(i,a,b) for(int (i)=int(a);(i)<int(b);(i)++)
 
#define INF 1000000001
#define MOD 1000000007
#define INF64 1000000000000000001
 
#define F first
#define S second
 
#define Pii pair<SINT32,SINT32>
#define Pll pair<SINT64,SINT64>
 
 
using namespace std;
 
int main() {
 
	SINT32 H,W,N;
	cin >> H >> W >> N;
 
	SINT32 y,x;
	cin >> y >> x;
 
	string Ss;
	string Ts;
	cin >> Ss;
	cin >> Ts;
 
	vector<SINT32> SR(N);
	vector<SINT32> SL(N);
	vector<SINT32> SU(N);
	vector<SINT32> SD(N);
	vector<SINT32> TR(N);
	vector<SINT32> TL(N);
	vector<SINT32> TU(N);
	vector<SINT32> TD(N);
 
	vector<SINT32> PSR(N);
	vector<SINT32> PSL(N);
	vector<SINT32> PSU(N);
	vector<SINT32> PSD(N);
	vector<SINT32> PTR(N);
	vector<SINT32> PTL(N);
	vector<SINT32> PTU(N);
	vector<SINT32> PTD(N);

	vector<SINT32> MAXR(N);
	vector<SINT32> MAXL(N);
	vector<SINT32> MAXU(N);
	vector<SINT32> MAXD(N);

	vector<SINT32> MAXR2(N);
	vector<SINT32> MAXL2(N);
	vector<SINT32> MAXU2(N);
	vector<SINT32> MAXD2(N);
 
 
	
	rep(i,0,N) {
		if (Ss[i] == 'R') {
			SR[i] = 1;
		} else if (Ss[i] == 'L') {
			SL[i] = 1;
		} else if (Ss[i] == 'U') {
			SU[i] = 1;
		} else {
			SD[i] = 1;
		}
	}
	rep(i,0,N) {
		if (Ts[i] == 'R') {
			TR[i] = 1;
		} else if (Ts[i] == 'L') {
			TL[i] = 1;
		} else if (Ts[i] == 'U') {
			TU[i] = 1;
		} else {
			TD[i] = 1;
		}
	}
 
	PSR[0] = SR[0];
	PSL[0] = SL[0];
	PSU[0] = SU[0];
	PSD[0] = SD[0];
	PTR[0] = TR[0];
	PTL[0] = TL[0];
	PTU[0] = TU[0];
	PTD[0] = TD[0];
 
	rep(i,1,N) {
		PSR[i] = SR[i] + PSR[i-1];
		PSL[i] = SL[i] + PSL[i-1];
		PSU[i] = SU[i] + PSU[i-1];
		PSD[i] = SD[i] + PSD[i-1];
		PTR[i] = TR[i] + PTR[i-1];
		PTL[i] = TL[i] + PTL[i-1];
		PTU[i] = TU[i] + PTU[i-1];
		PTD[i] = TD[i] + PTD[i-1];
	}

	rep(i,1,N) {
		PSR[i] = SR[i] + PSR[i-1];
		PSL[i] = SL[i] + PSL[i-1];
		PSU[i] = SU[i] + PSU[i-1];
		PSD[i] = SD[i] + PSD[i-1];
		PTR[i] = TR[i] + PTR[i-1];
		PTL[i] = TL[i] + PTL[i-1];
		PTU[i] = TU[i] + PTU[i-1];
		PTD[i] = TD[i] + PTD[i-1];
	}

	rep(i,0,N) {
		MAXR[i] = MAX(0,PSR[i] - PTL[i]);
		MAXL[i] = MAX(0,PSL[i] - PTR[i]);
		MAXU[i] = MAX(0,PSU[i] - PTD[i]);
		MAXD[i] = MAX(0,PSD[i] - PTU[i]);
	}

	MAXR2[N-1] = MAXR[N-1];
	MAXL2[N-1] = MAXL[N-1];
	MAXU2[N-1] = MAXU[N-1];
	MAXD2[N-1] = MAXD[N-1];

	for (SINT32 i = N-2; i >= 0; i--) {
		MAXR2[i] = MAX(MAXR2[i+1],MAXR[i]);
		MAXL2[i] = MAX(MAXL2[i+1],MAXL[i]);
		MAXU2[i] = MAX(MAXU2[i+1],MAXU[i]);
		MAXD2[i] = MAX(MAXD2[i+1],MAXD[i]);
	}
 
/*
	PSR.insert(PSR.begin(), 0);
	PSL.insert(PSL.begin(), 0);
	PSU.insert(PSU.begin(), 0);
	PSD.insert(PSD.begin(), 0);
	PTR.insert(PTR.begin(), 0);
	PTL.insert(PTL.begin(), 0);
	PTU.insert(PTU.begin(), 0);
	PTD.insert(PTD.begin(), 0);
	*/
/*
	rep(i,0,N) {
		cout << SR[i] <<  " ";
	}
	cout << endl;
	rep(i,0,N) {
		cout << PSL[i] <<  " ";
	}
	cout << endl;
	rep(i,0,N) {
		cout << TL[i] <<  " ";
	}
	cout << endl;
	*/
 
	SINT32 bufx = x;
	rep(i,0,N) {
		bufx += SR[i];
		if (bufx > W) {
			cout << "NO" << endl;
			return 0;
		}
		if (TL[i] == 1) {
			bufx--;
//			bufx = MAX(bufx,1);
			if (bufx < 1+MAXL2[i]) {
				bufx++;
			}
//			bufx = MAX(bufx,1+PSL[N-1]-PSL[i]);
		}
	}

	SINT32 bufy = y;
	rep(i,0,N) {
		bufy += SD[i];
		if (bufy > H) {
			cout << "NO" << endl;
			return 0;
		}
		if (TU[i] == 1) {
			bufy--;
//			bufy = MAX(bufy,1);
//			bufy = MAX(bufy,1+PSU[N-1]-PSU[i]);
			if (bufy < 1+MAXU2[i]) {
				bufy++;
			}
		}
	}

 
	bufx = x;
	rep(i,0,N) {
		bufx -= SL[i];
		if (bufx <= 0) {
			cout << "NO" << endl;
			return 0;
		}
		if (TR[i] == 1) {
			bufx++;
//			bufx = MIN(bufx,W);
//			bufx = MIN(bufx,W-(PSR[N-1]-PSR[i]));
			if (bufx > W-(MAXR2[i])) {
				bufx--;
			}
		}
	}
 
	bufy = y;
	rep(i,0,N) {
		bufy -= SU[i];
		if (bufy <= 0) {
			cout << "NO" << endl;
			return 0;
		}
		if (TD[i] == 1) {
			bufy++;
//			bufy = MIN(bufy,H);
//			bufy = MIN(bufy,H-(PSD[N-1]-PSD[i]));
			if (bufy > H-(MAXD2[i])) {
				bufy--;
			}
		}
	}
 
 
	cout << "YES" << endl;
	return 0;
}
 
//	sort(DATA.begin(),DATA.end());
//	sort(DATA.begin(),DATA.end(),std::greater<SINT32>());
//	__gcd(ANS,DATA[i]);
 
//	// DATA.emplace_back(BUF);	//後ろに追加
 
//  DATA.erase(std::unique(DATA.begin(), DATA.end()), DATA.end());	//ソート後に使用
 
//	DATA.insert(DATA.begin() + X, 0);	//X番目の要素に0を挿入
 
 
//	vector<vector<SINT32>> DP(N,vector<SINT32>(3));	//2次元配列
 
/*
	SINT32 M = 3;
	vector<pair<SINT32,SINT32>> DATA2(M);
	for (SINT32 i = 0; i < M; i++) {
		cin >> DATA2[i].first;
		cin >> DATA2[i].second;
	}
	sort(DATA2.begin(),DATA2.end());
	cout << DATA2[0].first << endl;
	cout << DATA2[0].second << endl;
*/
 
// 	vector<pair<int,pair<int,int>>> DATA(M);
//	cin >> DATA[i].first;
//	cin >> DATA[i].second.first;
//	cin >> DATA[i].second.second;
 
 
//		APOSI = lower_bound(ADATA.begin(),ADATA.end(),QDATA[i]) - ADATA.begin();	//key以上を探す
//		BPOSI = lower_bound(BDATA.begin(),BDATA.end(),QDATA[i]) - BDATA.begin();
 
 
/* 文字列回転
	string N;
	cin >> N;
	N = N[N.length()-1] + N.substr(0,N.length()-1);
*/
/* 文字列合成
	string N,M;
	cin >> N >> M;
	SINT64 ans = 0;
	ans = stoi(N+M);
*/
 
 
 
/* SET コンテナ
	set<SINT32> DATA;
	for (SINT32 i = 0; i < N; i++) {
		SINT32 buf;
		cin >> buf;
		DATA.insert(buf);
	}
 
	//全表示
    set<string>::iterator it; //  イテレータを用意
    for(it = DATA.begin(); it != DATA.end(); it++) {
        cout << *it << endl;
    }
 
	//N番目を一部表示
	set<string>::iterator it; //  イテレータを用意
	it = DATA.begin();
	rep (i,0,N) {
		it++;
	}
	cout << *it << endl;
*/
 
/* map
	map<string,SINT32> mp;
	SINT32 N = 0;
	SINT32 mx = 0;
 
	cin >> N;
	for (SINT32 i = 0; i < N; i++) {
		string s;
		cin >> s;
		mp[s]++;
	}
	for(auto it=mp.begin();it!=mp.end();it++) {
		mx=max(mx,it->second);
	}
 
*/

Measured memory_bytes: 19592