"use strict";
function I(t,i){this._s=t.split("\n"),this._c=0,this._l=0,this._f=i||Number}I.prototype.a=function(t){var i=this._s[this._l];if(i){var s=i.trim().split(" "),h=s[this._c];return this._c++,s.length===this._c&&(this._c=0,this._l++),t?t(h):this._f(h)}},I.prototype.l=function(t){var i=this._s[this._l];if(i)return this._c=0,this._l++,i.split(" ").map(t||this._f)},module.exports=I;

function main(input) {
  var o = new I(input);

  var h = o.a();
  var w = o.a();
  var n = o.a();

  var sr = o.a();
  var sc = o.a();

  var S = o.a(String);
  var T = o.a(String);

  var rl = [], lr = [], du = [], ud = [];
  rl[0] = S[0] === "R" ? 1 : 0;
  lr[0] = S[0] === "L" ? 1 : 0;
  du[0] = S[0] === "D" ? 1 : 0;
  ud[0] = S[0] === "U" ? 1 : 0;
  for (var i = 1; i < n; i ++) {
    rl[i] = rl[i - 1];
    if (T[i - 1] === "L") {
      rl[i] -= 1;
    }
    if (S[i] === "R") {
      rl[i] += 1;
    }

    lr[i] = lr[i - 1];
    if (T[i - 1] === "R") {
      lr[i] -= 1;
    }
    if (S[i] === "L") {
      lr[i] += 1;
    }

    du[i] = du[i - 1];
    if (T[i - 1] === "U") {
      du[i] -= 1;
    }
    if (S[i] === "D") {
      du[i] += 1;
    }

    ud[i] = ud[i - 1];
    if (T[i - 1] === "D") {
      ud[i] -= 1;
    }
    if (S[i] === "U") {
      ud[i] += 1;
    }

  }
  // console.log({rl, lr});

  function solve() {
    var cr = 0, cl = 0, cd = 0, cu = 0;
    for (var i = 0; i < n ; i ++) {
      if (T[i -1] !== undefined && T[i - 1] === "L") {
        cr -= 1;
        if (cr < 0) cr = 0;
      }
      if (S[i] === "R") cr += 1;
      if (cr >= w) return "NO";

  
      if (T[i -1] !== undefined && T[i - 1] === "R") {
        cl -= 1;
        if (cl < 0) cl = 0;
      }
      if (S[i] === "L") cl += 1;
      if (cl >= w) return "NO";

      if (T[i -1] !== undefined && T[i - 1] === "U") {
        cd -= 1;
        if (cd < 0) cd = 0;
      }
      if (S[i] === "U") cd += 1;
      if (cd >= h) return "NO";

      if (T[i -1] !== undefined && T[i - 1] === "D") {
        cu -= 1;
        if (cu < 0) cu = 0;
      }
      if (S[i] === "D") cu += 1;
      if (cu >= h) return "NO";
    }

    var rlimit = w - sc + 1;
    var llimit = sc;
    var dlimit = h - sr + 1;
    var ulimit = sr;
    // console.log({rlimit, llimit})

    // first step
    if (rlimit <= rl[0]) return "NO";
    if (llimit <= lr[0]) return "NO";
    if (dlimit <= du[0]) return "NO";
    if (ulimit <= ud[0]) return "NO";
    for (var i = 0; i < n; i++) {
      if (rlimit <= rl[i + 1]) {
        if (T[i] === "L") {
          // try to use l
          rlimit += 1;
          llimit -= 1
        } else {
          return "NO";
        }
      }

      if (llimit <= lr[i + 1]) {
        if (T[i] === "R") {
          // try to use r
          llimit += 1;
          rlimit -= 1
        } else {
          return "NO";
        }
      }

      if (dlimit <= du[i + 1]) {
        if (T[i] === "U") {
          // try to use u
          dlimit += 1;
          ulimit -= 1
        } else {
          return "NO";
        }
      }

      if (ulimit <= ud[i + 1]) {
        if (T[i] === "D") {
          // try to use d
          ulimit += 1;
          dlimit -= 1
        } else {
          return "NO";
        }
      }

      if (rlimit <= rl[i + 1]) return "NO";
      if (llimit <= lr[i + 1]) return "NO";
      if (dlimit <= du[i + 1]) return "NO";
      if (ulimit <= ud[i + 1]) return "NO";
    }

    return "YES";
  }

  console.log(solve());
}


main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 37836