#include <iostream>
#include <vector>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define vec vector

int main(void)
{
  int h, w, n;
  cin >> h >> w >> n;
  int sr, sc;
  cin >> sr >> sc;
  string s, t;
  cin >> s >> t;
  reverse(s.begin(), s.end());
  reverse(t.begin(), t.end());

  int rl = 1, rr = w, cl = 1, cr = h;
  rep(i, n) {
    if (t[i] == 'L' && rr > 0 && rr <= w - 1) rr++;
    else if (t[i] == 'R' && rl > 1 && rl <= w) rl--;
    else if (t[i] == 'U' && cr > 0 && cr <= h - 1) cr++;
    else if (t[i] == 'D' && cl > 1 && cl <= h) cl--;

    if (s[i] == 'L') rl++;
    else if (s[i] == 'R') rr--;
    else if (s[i] == 'U') cl++;
    else cr--;
    if (rl > rr || cl > cr) {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (rl <= sc && sc <= rr && cl <= sr && sr <= cr) cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0;
}
