def main():

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

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

    y -= 1

    x -= 1

    s, t = eval(input()), eval(input())



    u, d, l, r = 0, h - 1, 0, w - 1



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

        if tt == 'U': d = min(d + 1, h - 1)

        if tt == 'D': u = max(u - 1, 0)

        if tt == 'L': r = min(r + 1, w - 1)

        if tt == 'R': l = max(l - 1, 0)



        if ss == 'U': u += 1

        if ss == 'D': d -= 1

        if ss == 'L': l += 1

        if ss == 'R': r -= 1



        if l > r or u > d:

            print('NO')

            return



    if l <= x <= r and u <= y <= d:

        print('YES')

        return

    else:

        print('NO')

        return





if __name__ == '__main__':

    main()
def main():

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

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

    y -= 1

    x -= 1

    s, t = eval(input()), eval(input())



    u, d, l, r = 0, h - 1, 0, w - 1



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

        if tt == 'U':

            d = min(d + 1, h - 1)

        elif tt == 'D':

            u = max(u - 1, 0)

        elif tt == 'L':

            r = min(r + 1, w - 1)

        else:

            l = max(l - 1, 0)  # tt == 'R'



        if ss == 'U':

            u += 1

        elif ss == 'D':

            d -= 1

        elif ss == 'L':

            l += 1

        else:

            r -= 1  # ss == 'R'



        if l > r or u > d:

            print('NO')

            return



    if l <= x <= r and u <= y <= d:

        print('YES')

        return

    else:

        print('NO')

        return





if __name__ == '__main__':

    main()
def main():
    h, w, n = list(map(int, input().split()))
    y, x = list(map(int, input().split()))
    y -= 1
    x -= 1
    s, t = eval(input()), eval(input())
    u, d, l, r = 0, h - 1, 0, w - 1
    for ss, tt in zip(s[::-1], t[::-1]):
        if tt == "U":
            d = min(d + 1, h - 1)
        if tt == "D":
            u = max(u - 1, 0)
        if tt == "L":
            r = min(r + 1, w - 1)
        if tt == "R":
            l = max(l - 1, 0)
        if ss == "U":
            u += 1
        if ss == "D":
            d -= 1
        if ss == "L":
            l += 1
        if ss == "R":
            r -= 1
        if l > r or u > d:
            print("NO")
            return
    if l <= x <= r and u <= y <= d:
        print("YES")
        return
    else:
        print("NO")
        return


if __name__ == "__main__":
    main()

def main():
    h, w, n = list(map(int, input().split()))
    y, x = list(map(int, input().split()))
    y -= 1
    x -= 1
    s, t = eval(input()), eval(input())
    u, d, l, r = 0, h - 1, 0, w - 1
    for ss, tt in zip(s[::-1], t[::-1]):
        if tt == "U":
            d = min(d + 1, h - 1)
        elif tt == "D":
            u = max(u - 1, 0)
        elif tt == "L":
            r = min(r + 1, w - 1)
        else:
            l = max(l - 1, 0)  # tt == 'R'
        if ss == "U":
            u += 1
        elif ss == "D":
            d -= 1
        elif ss == "L":
            l += 1
        else:
            r -= 1  # ss == 'R'
        if l > r or u > d:
            print("NO")
            return
    if l <= x <= r and u <= y <= d:
        print("YES")
        return
    else:
        print("NO")
        return


if __name__ == "__main__":
    main()

-        if tt == "D": +        elif tt == "D": -        if tt == "L": +        elif tt == "L": -        if tt == "R": -            l = max(l - 1, 0) +        else: +            l = max(l - 1, 0)  # tt == 'R' -        if ss == "D": +        elif ss == "D": -        if ss == "L": +        elif ss == "L": -        if ss == "R": -            r -= 1 +        else: +            r -= 1  # ss == 'R'