#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define ll long long
int main(){
  int H,W,N;
  cin>>H>>W>>N;
  int Sr,Sc;
  cin>>Sr>>Sc;
  string S,T;
  cin>>S>>T;
  int X[4]={};
  int f=1;
  rep(i,N){
    if(S[i]=='U') X[0]++;
    else if(S[i]=='D') X[1]++;
    else if(S[i]=='L') X[2]++;
    else if(S[i]=='R') X[3]++;
    if(X[0]==Sr||X[1]==H-Sr+1||X[2]==Sc||X[3]==W-Sc+1){
      cout<<"NO"<<endl;
      f=0;
      break;
    }
    if(T[i]=='U'&&X[1]>1-Sr) X[1]--;
    else if(T[i]=='D'&&X[0]>Sr-H) X[0]--;
    else if(T[i]=='L'&&X[3]>1-Sc) X[3]--;
    else if(T[i]=='R'&&X[2]>Sc-H) X[2]--;
  }
  if(f) cout<<"YES"<<endl;
}