// Original C++ solution (slower):
#include<bits/stdc++.h>

#include<ext/pb_ds/assoc_container.hpp>

#include<ext/pb_ds/tree_policy.hpp>

#define pi 3.141592653589793238

#define int long long

using namespace __gnu_pbds;

using namespace std;

template <typename T>

using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;



// mt19937 gen_rand_int(chrono::steady_clock::now().time_since_epoch().count());

// mt19937_64 gen_rand_ll(chrono::steady_clock::now().time_since_epoch().count());

// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());



long long power(long long a, long long b,long long m) {

    long long res = 1;

    while (b > 0) {

        if (b & 1)

            res = res * a %m;

        a = a * a %m;

        b >>= 1;

    }

    return res;

}





signed main()

{

ios_base::sync_with_stdio(false);

cin.tie(NULL);  

cout.tie(0);   



#ifndef ONLINE_JUDGE

    if(fopen("INPUT.txt","r"))

    {

    freopen ("INPUT.txt" , "r" , stdin);

    freopen ("OUTPUT.txt" , "w" , stdout);

    }

#endif  



    int n,m,k;

    cin>>n>>m>>k;

    int x,y;

    cin>>x>>y;

    string s,t;

    cin>>s>>t;

    int xx=0;

    for(int i=0;i<k;i++)

    {

        if(s[i]=='L')

            xx++;

        if(xx>=y)

        {

            cout<<"NO";

            return 0;

        }

        if(t[i]=='R')

        {

            if(xx<=0)

            {

                if(abs(xx)+y+1>m)

                    continue;

            }

                xx--;

        }

    }

    xx=0;

    for(int i=0;i<k;i++)

    {

        if(s[i]=='R')

            xx++;

        if(xx+y>m)

        {

            cout<<"NO";

            return 0;

        }

        if(t[i]=='L')

        {

            if(xx<=0)

            {

                if(abs(xx)+1>=y)

                    continue;

            }

                xx--;

        }

    }

    xx=0;

    for(int i=0;i<k;i++)

    {

        if(s[i]=='U')

            xx++;

        if(xx>=x)

        {

            cout<<"NO";

            return 0;

        }

        if(t[i]=='D')

        {

            if(xx<=0)

            {

                if(abs(xx)+x+1>n)

                    continue;

            }

                xx--;

        }

    }

    xx=0;

    for(int i=0;i<k;i++)

    {

        if(s[i]=='D')

            xx++;

        if(xx+x>n)

        {

            cout<<"NO";

            return 0;

        }

        if(t[i]=='U')

        {

            if(xx<=0)

            {

                if(abs(xx)+1>=x)

                    continue;

            }

                xx--;

        }

    }

    cout<<"YES";



} 

    


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

using namespace std;



char s1[200001],s2[200001];

int main(){

	int n,m,k;

	int x,y;

	scanf("%d%d%d",&n,&m,&k);

	scanf("%d%d%s%s",&x,&y,s1+1,s2+1);

	int l1=1,r1=n,l2=1,r2=m;

	for(int i=k;i;i--){

		if(s2[i]=='U')r1=min(n,r1+1);

		if(s2[i]=='D')l1=max(1,l1-1);

		if(s2[i]=='L')r2=min(m,r2+1);

		if(s2[i]=='R')l2=max(1,l2-1);

		if(s1[i]=='U')l1++;

		if(s1[i]=='D')r1--;

		if(s1[i]=='L')l2++;

		if(s1[i]=='R')r2--;

		//printf("%d %d %d %d\n",l1,r1,l2,r2);

		if(l1>r1||l2>r2){

			printf("NO\n");

			return 0;

		}

	}

	if(x>=l1&&x<=r1&&y>=l2&&y<=r2)

		printf("YES\n");

	else printf("NO\n");

}

// Fastest known solution for this problem: