using System;
using System.Collections.Generic;
using System.Linq;

public struct Point
{
    public int X;
    public int Y;

    public Point(Point p)
    {
        X = p.X;
        Y = p.Y;
    }

    public Point(int x, int y)
    {
        X = x;
        Y = y;
    }

    public static bool operator ==(Point a, Point b)
    {
        return (a.X == b.X && a.Y == b.Y);
    }

    public static bool operator !=(Point a, Point b)
    {
        return !(a == b);
    }

    //objと自分自身が等価のときはtrueを返す
    public override bool Equals(object obj)
    {
        if (!(obj is Point))
        {
            return false;
        }

        Point p = (Point)obj;
        return (X == p.X && Y == p.Y);
    }

    //Equalsがtrueを返すときに同じ値を返す
    public override int GetHashCode()
    {
        return (X << 16) ^ Y;
    }

    public Point Clone()
    {
        return new Point(X, Y);
    }

    public void Reverse()
    {
        X = -X;
        Y = -Y;
    }

    public static Point operator +(Point a, Point b)
    {
        return new Point(a.X + b.X, a.Y + b.Y);
    }

    public static Point operator -(Point a, Point b)
    {
        return new Point(a.X - b.X, a.Y - b.Y);
    }

    public static Point operator *(Point a, int i)
    {
        return new Point(a.X * i, a.Y * i);
    }

    public static Point operator /(Point a, int i)
    {
        return new Point(a.X / i, a.Y / i);
    }
    public static Point operator +(Point a)
    {
        return new Point(+a.X, +a.Y);
    }

    public static Point operator -(Point a)
    {
        return new Point(-a.X, -a.Y);
    }

    public override string ToString()
    {
        return string.Format("({0},{1})", X, Y);
    }

    private IEnumerable<Point> _GetNeighbors()
    {
        yield return new Point(X + 1, Y + 0);
        yield return new Point(X + 0, Y + 1);
        yield return new Point(X - 1, Y + 0);
        yield return new Point(X + 0, Y - 1);
    }

    public bool InRange(Point max)
    {
        return 0 <= X && X < max.X && 0 <= Y && Y < max.Y;
    }

    public IEnumerable<Point> GetNeighbors()
    {
        return _GetNeighbors().Where(p => p.InRange(Max));
    }

    public static Point Max;
}

public class Solution
{
    public static void Main()
    {
        var vals = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var max = new Point(vals[1], vals[0]);
        var n = vals[2];
        vals = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var start = new Point(vals[1] - 1, vals[0] - 1); // 0originにする
        var s = Console.ReadLine();
        var t = Console.ReadLine();

        var result = true;
        // 左
        var cur = start.X;
        for (int i = 0; i < n; i++)
        {
            if (s[i] == 'L')
            {
                cur--;
            }
            if (cur < 0)
            {
                result = false;
                Console.Error.WriteLine("LEFT");
                break;
            }
            if (t[i] == 'R')
            {
                cur = Math.Min(cur + 1, max.X - 1);
            }
        }

        // 右
        cur = start.X;
        for (int i = 0; i < n; i++)
        {
            if (s[i] == 'R')
            {
                cur++;
            }
            if (cur >= max.X)
            {
                result = false;
                Console.Error.WriteLine("RIGHT");
                break;
            }
            if (t[i] == 'L')
            {
                cur = Math.Max(cur - 1, 0);
            }
        }

        // 上
        cur = start.Y;
        for (int i = 0; i < n; i++)
        {
            if (s[i] == 'U')
            {
                cur--;
            }
            if (cur < 0)
            {
                result = false;
                Console.Error.WriteLine("UP");
                break;
            }
            if (t[i] == 'D')
            {
                cur = Math.Min(cur + 1, max.Y - 1);
            }
        }

        // 下
        cur = start.Y;
        for (int i = 0; i < n; i++)
        {
            if (s[i] == 'D')
            {
                cur++;
            }
            if (cur >= max.Y)
            {
                result = false;
                Console.Error.WriteLine("DOWN");
                break;
            }
            if (t[i] == 'U')
            {
                cur = Math.Max(cur - 1, 0);
            }
        }

        if (result)
        {
            Console.WriteLine("YES");
        }
        else
        {
            Console.WriteLine("NO");
        }
    }
}

Measured memory_bytes: 14688