import collections



h, w, n = list(map(int, input().split()))

y, x = list(map(int, input().split()))

s = input().rstrip()

t = input().rstrip()

counter = collections.Counter()

for c in s:

    counter[c] += 1





def check(counts, direction, opposite_direction, pos, target):

    for i in range(n):

        counts[direction] -= 1

        if s[i] == direction:

            pos += 1

        if pos == target:

            return False

        if t[i] == opposite_direction and pos > 1 and counts[

                opposite_direction] < pos:

            pos -= 1



    return True





for d, od, pos, target in [

    ('R', 'L', x, w + 1),

    ('L', 'R', w + 1 - x, w + 1),

    ('D', 'U', y, h + 1),

    ('U', 'D', h + 1 - y, h + 1),

]:

    ok = check(collections.Counter(list(counter.items())), d, od, pos, target)

    if not ok:

        print('NO')

        break

else:

    print('YES')
h, w, n = list(map(int, input().split()))

y, x = list(map(int, input().split()))

s = input().rstrip()

t = input().rstrip()





def check(direction, opposite_direction, pos, target):

    for i in range(n):

        if s[i] == direction:

            pos += 1

        if pos == target:

            return False

        if t[i] == opposite_direction and pos > 1:

            pos -= 1

    return True





for d, od, pos, target in [

    ('R', 'L', x, w + 1),

    ('L', 'R', w + 1 - x, w + 1),

    ('D', 'U', y, h + 1),

    ('U', 'D', h + 1 - y, h + 1),

]:

    ok = check(d, od, pos, target)

    if not ok:

        print('NO')

        break

else:

    print('YES')
import collections

h, w, n = list(map(int, input().split()))
y, x = list(map(int, input().split()))
s = input().rstrip()
t = input().rstrip()
counter = collections.Counter()
for c in s:
    counter[c] += 1


def check(counts, direction, opposite_direction, pos, target):
    for i in range(n):
        counts[direction] -= 1
        if s[i] == direction:
            pos += 1
        if pos == target:
            return False
        if t[i] == opposite_direction and pos > 1 and counts[opposite_direction] < pos:
            pos -= 1
    return True


for d, od, pos, target in [
    ("R", "L", x, w + 1),
    ("L", "R", w + 1 - x, w + 1),
    ("D", "U", y, h + 1),
    ("U", "D", h + 1 - y, h + 1),
]:
    ok = check(collections.Counter(list(counter.items())), d, od, pos, target)
    if not ok:
        print("NO")
        break
else:
    print("YES")

h, w, n = list(map(int, input().split()))
y, x = list(map(int, input().split()))
s = input().rstrip()
t = input().rstrip()


def check(direction, opposite_direction, pos, target):
    for i in range(n):
        if s[i] == direction:
            pos += 1
        if pos == target:
            return False
        if t[i] == opposite_direction and pos > 1:
            pos -= 1
    return True


for d, od, pos, target in [
    ("R", "L", x, w + 1),
    ("L", "R", w + 1 - x, w + 1),
    ("D", "U", y, h + 1),
    ("U", "D", h + 1 - y, h + 1),
]:
    ok = check(d, od, pos, target)
    if not ok:
        print("NO")
        break
else:
    print("YES")

-import collections - -counter = collections.Counter() -for c in s: -    counter[c] += 1 -def check(counts, direction, opposite_direction, pos, target): +def check(direction, opposite_direction, pos, target): -        counts[direction] -= 1 -        if t[i] == opposite_direction and pos > 1 and counts[opposite_direction] < pos: +        if t[i] == opposite_direction and pos > 1: -    ok = check(collections.Counter(list(counter.items())), d, od, pos, target) +    ok = check(d, od, pos, target)