import sys



input = sys.stdin.readline





def main():

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

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

    y -= 1

    x -= 1

    s, t = input().rstrip(), input().rstrip()



    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()))

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



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



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

        if tt == 'U':

            d = min(d + 1, h)

        elif tt == 'D':

            u = max(u - 1, 1)

        elif tt == 'L':

            r = min(r + 1, w)

        else:

            l = max(l - 1, 1)  # 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()
import sys

input = sys.stdin.readline


def main():
    h, w, n = list(map(int, input().split()))
    y, x = list(map(int, input().split()))
    y -= 1
    x -= 1
    s, t = input().rstrip(), input().rstrip()
    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()))
    s, t = eval(input()), eval(input())
    u, d, l, r = 1, h, 1, w
    for ss, tt in zip(s[::-1], t[::-1]):
        if tt == "U":
            d = min(d + 1, h)
        elif tt == "D":
            u = max(u - 1, 1)
        elif tt == "L":
            r = min(r + 1, w)
        else:
            l = max(l - 1, 1)  # 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()

-import sys - -input = sys.stdin.readline - - -    y -= 1 -    x -= 1 -    s, t = input().rstrip(), input().rstrip() -    u, d, l, r = 0, h - 1, 0, w - 1 +    s, t = eval(input()), eval(input()) +    u, d, l, r = 1, h, 1, w -            d = min(d + 1, h - 1) +            d = min(d + 1, h) -            u = max(u - 1, 0) +            u = max(u - 1, 1) -            r = min(r + 1, w - 1) +            r = min(r + 1, w) -            l = max(l - 1, 0)  # tt == 'R' +            l = max(l - 1, 1)  # tt == 'R'