#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"h,w,n=map(int,input().split())\n"
"r,c=map(int,input().split())\n"
"s=input()\n"
"t=input()\n"
"xr=xl=xd=xu=yr=yl=yd=yu=0\n"
"for i in range(n):\n"
"    xr+=s[i]=='R'\n"
"    xl+=s[i]=='L'\n"
"    xd+=s[i]=='D'\n"
"    xu+=s[i]=='U'\n"
"    if w-c-(xr-yl)<0 or c-1-(xl-yr)<0 or h-r-(xd-yu)<0 or r-1-(xu-yd)<0:\n"
"        print('NO')\n"
"        break\n"
"    yr+=t[i]=='R'\n"
"    yr-=w-c-(yr-xl)<0\n"
"    yl+=t[i]=='L'\n"
"    yl-=c-1-(yl-xr)<0\n"
"    yd+=t[i]=='D'\n"
"    yd-=h-r-(yd-xu)<0\n"
"    yu+=t[i]=='U'\n"
"    yu-=r-1-(yu-xd)<0\n"
"else:\n"
"    print('YES')\n"
"\"";
  system(s);
  return 0;
}            