def check(dist, tak, aok, lim):

    for s, t in zip(ss, ts):

        if s == tak:

            if dist == 0:

                return True

            dist -= 1

        if t == aok:

            if dist < lim:

                dist += 1

    return False





def solve():

    if check(sr - 1, 'U', 'D', h - 1):

        return True

    if check(sc - 1, 'L', 'R', w - 1):

        return True

    if check(h - sr, 'D', 'U', h - 1):

        return True

    if check(w - sc, 'R', 'L', w - 1):

        return True

    return False





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

sr, sc = list(map(int, input().split()))

ss = eval(input())

ts = eval(input())

print(('NO' if solve() else 'YES'))

def solve():

    lim_u = 0

    lim_b = h

    lim_l = 0

    lim_r = w

    for s, t in zip(ss[::-1], ts[::-1]):

        if t == 'U':

            if lim_b < h:

                lim_b += 1

        elif t == 'D':

            if lim_u > 0:

                lim_u -= 1

        elif t == 'L':

            if lim_r < w:

                lim_r += 1

        else:

            if lim_l > 0:

                lim_l -= 1

        if s == 'U':

            lim_u += 1

        elif s == 'D':

            lim_b -= 1

        elif s == 'L':

            lim_l += 1

        else:

            lim_r -= 1



        if lim_u >= lim_b or lim_l >= lim_r:

            return False



    return lim_u < sr <= lim_b and lim_l < sc <= lim_r





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

sr, sc = list(map(int, input().split()))

ss = eval(input())

ts = eval(input())

print(('YES' if solve() else 'NO'))

def check(dist, tak, aok, lim):
    for s, t in zip(ss, ts):
        if s == tak:
            if dist == 0:
                return True
            dist -= 1
        if t == aok:
            if dist < lim:
                dist += 1
    return False


def solve():
    if check(sr - 1, "U", "D", h - 1):
        return True
    if check(sc - 1, "L", "R", w - 1):
        return True
    if check(h - sr, "D", "U", h - 1):
        return True
    if check(w - sc, "R", "L", w - 1):
        return True
    return False


h, w, n = list(map(int, input().split()))
sr, sc = list(map(int, input().split()))
ss = eval(input())
ts = eval(input())
print(("NO" if solve() else "YES"))

def solve():
    lim_u = 0
    lim_b = h
    lim_l = 0
    lim_r = w
    for s, t in zip(ss[::-1], ts[::-1]):
        if t == "U":
            if lim_b < h:
                lim_b += 1
        elif t == "D":
            if lim_u > 0:
                lim_u -= 1
        elif t == "L":
            if lim_r < w:
                lim_r += 1
        else:
            if lim_l > 0:
                lim_l -= 1
        if s == "U":
            lim_u += 1
        elif s == "D":
            lim_b -= 1
        elif s == "L":
            lim_l += 1
        else:
            lim_r -= 1
        if lim_u >= lim_b or lim_l >= lim_r:
            return False
    return lim_u < sr <= lim_b and lim_l < sc <= lim_r


h, w, n = list(map(int, input().split()))
sr, sc = list(map(int, input().split()))
ss = eval(input())
ts = eval(input())
print(("YES" if solve() else "NO"))

-def check(dist, tak, aok, lim): -    for s, t in zip(ss, ts): -        if s == tak: -            if dist == 0: -                return True -            dist -= 1 -        if t == aok: -            if dist < lim: -                dist += 1 -    return False - - -    if check(sr - 1, "U", "D", h - 1): -        return True -    if check(sc - 1, "L", "R", w - 1): -        return True -    if check(h - sr, "D", "U", h - 1): -        return True -    if check(w - sc, "R", "L", w - 1): -        return True -    return False +    lim_u = 0 +    lim_b = h +    lim_l = 0 +    lim_r = w +    for s, t in zip(ss[::-1], ts[::-1]): +        if t == "U": +            if lim_b < h: +                lim_b += 1 +        elif t == "D": +            if lim_u > 0: +                lim_u -= 1 +        elif t == "L": +            if lim_r < w: +                lim_r += 1 +        else: +            if lim_l > 0: +                lim_l -= 1 +        if s == "U": +            lim_u += 1 +        elif s == "D": +            lim_b -= 1 +        elif s == "L": +            lim_l += 1 +        else: +            lim_r -= 1 +        if lim_u >= lim_b or lim_l >= lim_r: +            return False +    return lim_u < sr <= lim_b and lim_l < sc <= lim_r -print(("NO" if solve() else "YES")) +print(("YES" if solve() else "NO"))