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

#define int long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define dbg3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define dbgB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }

template<typename T>
void print1(T begin, T end) {
  while (begin != end) {
    cerr << (*begin) << " ";
    *begin++;
  }
  cerr << endl;
}

template<typename T>
void print2(T Array, int height, int width) {
  for (int i = 0; i < height; i++) {
    for (int j = 0; j < width; j++) {
      cerr << " " << Array[i][j];
    }
    cerr << endl;
  }
}

void print() { std::cerr << endl; }
template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
  std::cerr << head << " ";
  print(std::forward<Tail>(tail)...);
}

template<class T>
void Add(T &a, const T &b, const T &mod=1000000007) {
  int val = ((a % mod) + (b % mod)) % mod;
  if (val < 0) { val += mod; }
  a = val;
}

template <typename X, typename T> auto vectors(X x, T a) { return vector<T>(x, a); }
template <typename X, typename Y, typename Z, typename... Zs> auto vectors(X x, Y y, Z z, Zs... zs) { auto cont = vectors(y, z, zs...); return vector<decltype(cont)>(x, cont); }

// ------------------------------------------------------------------------------------------

using pii = pair<int, int>;

int H, W, N;
int sy, sx;
int ty, tx;
string s, t;
string g;
map<char, pii> mp = {
  {'R', {0, 1}},
  {'L', {0, -1}},
  {'U', {-1, 0}},
  {'D', {1, 0}},
};

bool check(int y, int x) {
  return y < 0 or y > H or x < 0 or x > W;
}

int dfs(int idx, int yy, int xx) {
  if (check(yy, xx)) {
  dbg3(idx, yy, xx)
  // dbg3(idx, yy, xx)
    // dbg2(yy, H)
    // dbg2(xx, W)
    return 1;
  }
  if (idx >= 2*N) {
    return 0;
  }

  int ret = 0;

  if (idx % 2 == 0) { // 先手
    // no
    ret |= dfs(idx+1, yy, xx);
    // yes
    int ny = yy + mp[g[idx]].first;
    int nx = xx + mp[g[idx]].second;
    ret |= dfs(idx+1, ny, nx);
  } else { // 後手
    // no
    ret |= dfs(idx+1, yy, xx);
    // yes
    int ny = yy + mp[g[idx]].first;
    int nx = xx + mp[g[idx]].second;
    if (ny < 0) ny = 0;
    if (ny > H) ny = H;
    if (nx < 0) nx = 0;
    if (ny > W) nx = W;
    ret |= dfs(idx+1, ny, nx);
  }

  // dbg(ret)
  return ret;
}

signed main() {
  cin >> H >> W >> N;
  cin >> sy >> sx;
  cin >> s >> t;

  bool ok = true; // ハミ出ない

  // 右に行く
  ty = sy, tx = sx;
  rep (i, N) {
    // T
    if (s[i] == 'R') tx++;
    if (tx > W) ok = false;

    // A
    if (t[i] == 'L' and tx >= 2) {
      tx--;
    }
    // dbg(tx)
  }

  // 左に行く
  ty = sy, tx = sx;
  rep (i, N) {
    // T
    if (s[i] == 'L') tx--;
    if (tx <= 0) ok = false;

    // A
    if (t[i] == 'R' and tx <= W-1) {
      tx++;
      // chmin(tx, W);
    }
  }

  // 上に行く
  ty = sy, tx = sx;
  rep (i, N) {
    // T
    if (s[i] == 'U') ty--;
    if (ty <= 0) ok = false;

    // A
    if (t[i] == 'D' and ty <= H-1) {
      ty++;
      // chmax(ty, H);
    }
  }

  // 下に行く
  ty = sy, tx = sx;
  rep (i, N) {
    // T
    if (s[i] == 'D') ty++;
    if (ty > H) ok = false;

    // A
    if (t[i] == 'U' and ty >= 2) {
      ty--;
      // chmax(ty, 1ll);
    }
  }

  puts(ok ? "YES" : "NO");

  return 0;
}

Measured memory_bytes: 776