import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.exception;

enum letters = "LRUD";

enum dy = [0, 0, -1, 1];
enum dx = [-1, 1, 0, 0];
enum inf = int.max >> 1;

int f (dchar c) {
  foreach (i; 0 .. 4) {
    if (c == letters[i])  return i;
  }
  enforce (false);
  return -1;
}

struct S {
  int u;
  int v;
  int value;
}


bool first (in int[] s, in int[] t, in int[] d, in int u, in int m) {
  immutable x = s.map! (k => d[k]).array.idup;
  immutable y = t.map! (k => d[k]).array.idup;
  debug stderr.writeln ("s = ", s);
  debug stderr.writeln ("t = ", t);
  debug stderr.writeln ("x = ", x);
  debug stderr.writeln ("y = ", y);
  int r1 = 1, r2 = m + 1;
  assert (s.length == t.length);
  foreach_reverse (i; 0 .. s.length) {
    //step 2
    if (i < s.length - 1) {
      if (y[i] < 0) r2++;
      if (y[i] > 0) r1--;
      r1 = max (r1, 1);
      r2 = min (r2, m + 1);
    }
    debug stderr.writefln ("2: i = %d, r1 = %d, r2 = %d", i, r1, r2);
    //step 1
    if (x[i] < 0) r1++;
    if (x[i] > 0) r2--;
    r1 = max (r1, 1);
    r2 = min (r2, m + 1);
    debug stderr.writefln ("1: i = %d, r1 = %d, r2 = %d", i, r1, r2);
    if (r1 >= r2) return true;
  }
  r1 = max (r1, u);
  r2 = min (r2, u + 1);
  return r1 >= r2;
}

void main() {
  auto zz = readln.split.map!(a => a.to!int).array;
  immutable h = zz[0], w = zz[1], n = zz[2];
  zz = readln.split.map!(a => a.to!int).array;
  immutable y = zz[0], x = zz[1];
  auto s = readln.take(n).map!f.array.idup;
  auto t = readln.take(n).map!f.array.idup;
  writeln ((first (s, t, dx, x, w) || first (s, t, dy, y, h)) ? "NO" : "YES");
}

