using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

class Program
{
    static void Main()
    {
        int[] HWN = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
        int H = HWN[0];
        int W = HWN[1];
        int N = HWN[2];

        int[] rc = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();

        int sr = rc[0];
        int sc = rc[1];

        string S = Console.ReadLine();
        string T = Console.ReadLine();


        bool ans = false;


        //上に出す
        {
            //上に出るまでの移動回数
            int y = sr;

            for (int i = 0; i < N; i++)
            {
                var cS = S[i];
                var cT = T[i];

                if (cS == 'U')
                {
                    y--;
                    if (y <= 0)
                    {
                        ans = true;
                        break;
                    }
                }
                if (cT == 'D' && y + 1 <= H)
                {
                    y++;
                }
            }
        }


        //右に出す
        {
            int x = sc;

            for (int i = 0; i < N; i++)
            {
                var cS = S[i];
                var cT = T[i];

                if (cS == 'R')
                {
                    x++;
                    if (x > W)
                    {
                        ans = true;
                        break;
                    }
                }
                if (cT == 'L' && x - 1 >= 1)
                {
                    x--;
                }
            }
        }

        //左に出す
        {
            int x = sc;

            for (int i = 0; i < N; i++)
            {
                var cS = S[i];
                var cT = T[i];

                if (cS == 'L')
                {
                    x--;
                    if (x <= 0)
                    {
                        ans = true;
                        break;
                    }
                }
                if (cT == 'R' && x + 1 <= W)
                {
                    x++;
                }
            }
        }

        //下に出す
        {
            int y = sr;

            for (int i = 0; i < N; i++)
            {
                var cS = S[i];
                var cT = T[i];

                if (cS == 'D')
                {
                    y++;
                    if (y > H)
                    {
                        ans = true;
                        break;
                    }
                }
                if (cT == 'U' && y - 1 >= 1)
                {
                    y--;
                }
            }
        }

        Console.WriteLine(ans ? "NO" : "YES");

    }
}



static class MathUtil
{
    public static IEnumerable<IEnumerable<int>> GetPermutation(int n)
    {
        if (n == 0)
        {
            yield return Single(0);
            yield break;
        }

        for (int i = 0; i <= n; i++)
        {
            foreach (var x in GetPermutation(n - 1))
            {
                yield return Single(i).Concat(x.Select(itm => itm < i ? itm : itm + 1));
            }
        }
    }

    private static IEnumerable<int> Single(int x)
    {
        yield return x;
    }

    public static IEnumerable<int> EnumeratePrimeNumbers()
    {
        List<int> primes = new List<int>() { 2 };
        yield return 2;

        for (int i = 3; i < int.MaxValue; i++)
        {
            bool isPrime = true;
            int Sqrt = (int)Math.Sqrt(i) + 1;

            foreach (var prime in primes)
            {
                if (prime > Sqrt)
                {
                    break;
                }
                if (i % prime == 0)
                {
                    isPrime = false;
                    break;
                }
            }

            if (isPrime)
            {
                primes.Add(i);
                yield return i;
            }
        }
    }
}



Measured memory_bytes: 14560