#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
#include <string>
using namespace std;

int main()
{
	int dirs[4][3] = {
		{1, 0, 1}, {0, 1, 1}, {-1, 0, 1}, {0, -1, 1}};

	int W, H, N;
	cin >> H >> W >> N;
	int sr, sc;
	cin >> sr >> sc;
	string S, T;
	cin >> S;
	cin >> T;
	int wl,wr,hd,hu;
	wl = wr = sc;
	hd= hu =sr;

	for (int i = 0; i <S.size(); i++)
	{
		
		if (S[i] == 'L'){
			wl--;
		}
		if (S[i] == 'R'){
			wr++;
		}
		if (S[i] == 'U')
			hu--;
		if (S[i] == 'D')
			hd++;
		if (wl <=0 || wr>W || hu<=0 || hd>H){
			cout<<"NO"<<endl;
			return 0;
		} 

		if (T[i] == 'L')
			wr = max(1,wr-1);
		if (T[i] == 'R')
			wl = min(W,wl+1);
		if (T[i] == 'U')
			hd = max(1,hd-1);
		if (T[i] == 'D')
			hu = min(H,hu+1);

	}
	cout << "YES" << endl;
	return 0;
}