#include <bits/stdc++.h>
using namespace std;
using Int = long long;
int main()
{
    int H, W, N, sr, sc; cin >> H >> W >> N >> sr >> sc;
    string S, T; cin >> S >> T;
    int a = 0, b = 0, c = 0, d = 0;
    for (int i = N-1; i >= 0; i--) {
        if (T[i] == 'L') b = max(b-1, 0);
        if (T[i] == 'R') a = max(a-1, 0);
        if (T[i] == 'U') d = max(d-1, 0);
        if (T[i] == 'D') c = max(c-1, 0);
        if (S[i] == 'L') a++;
        if (S[i] == 'R') b++;
        if (S[i] == 'U') c++;
        if (S[i] == 'D') d++;
        if (a + b >= W || c + d >= H) {
            cout << "NO\n";
            return 0;
        }
    }
    if (a >= sc || b >= (W - sc + 1) || c >= sr || d >= (H - sr + 1)) {
        cout << "NO\n";
    } else {
        cout << "YES\n";
    }
    return 0;
}