#include <bits/stdc++.h>
using namespace std;

int main()
{
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int r, c, n, sr, sc;
  cin >> r >> c >> n >> sr >> sc;
  string s, t;
  cin >> s >> t;
  int tl = sc, tr = sc, tu = sr, td = sr;
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'L') {
      --tr;
    } else if (s[i] == 'R') {
      ++tl;
    } else if (s[i] == 'U') {
      --td;
    } else {
      ++tu;
    }
    if (tr < 1 || tl > c || td < 1 || tu > r) {
      cout << "NO" << endl;
      return 0;
    }
    if (t[i] == 'L') {
      tl = max(1, tl - 1);
    } else if (t[i] == 'R') {
      tr = min(c, tr + 1);
    } else if (t[i] == 'U') {
      tu = max(1, tu - 1);
    } else {
      td = min(r, td + 1);
    }
  }
  cout << "YES" << endl;
  return 0;
}

