#include<bits/stdc++.h>

using namespace std;

int H,W,N;
int SX,SY;
int U,D,L,R;
int nu,nd,nl,nr;
char s[200005],t[200005];
int main() {
	scanf("%d%d%d%d%d",&H,&W,&N,&SX,&SY);
	scanf("%s%s",&s[1],&t[1]);
	U = D = SX; L = R = SY;
	nu = nd = SX; nl = nr = SY;
	for(int i=1;i<=N;i++) {
		if(s[i]=='U') {
			nu--; U = min(U,nu);
		} else if(s[i]=='D') {
			nd++; D = max(D,nd);
		} else if(s[i]=='L') {
			nl--; L = min(L,nl);
		} else {
			nr++; R = max(R,nr);
		}

		if(t[i]=='U') {
			nd  = max(1,nd-1);
		} else if(t[i]=='D') {
			nu = min(H,nu+1);
		} else if(t[i]=='L') {
			nr = max(1,nr-1);
		} else {
			nl=min(W,nl+1);
		}
	}
	if(U<=0||D>H||L<=0||R>W) puts("NO");
	else puts("YES");
}