#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
using ll = long long;

#define int long long
#define all(x) x.begin(), x.end()

const int inf = 1e18;
const int mod = 998244353;

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

struct segTree {
    vector<int> t;
    int n;

    segTree(int x) {
        n = x;
        t.assign(2 * n, inf);
        // for (int i = 0; i < n; i++) t[i + n] = a[i];
        // for (int i = n - 1; i >= 0; i--) t[i] = max(t[i << 1], t[(i << 1) | 1]);
    }

    int get(int l, int r) {
        int ans = -inf;
        l += n, r += n;
        while (l < r) {
            if (l & 1) ans = max(ans, t[l++]);
            if (r & 1) ans = max(ans, t[--r]);
            l >>= 1, r >>= 1;
        }
        return ans;
    }

    void upd(int i, int x) {
        i += n, t[i] = x, i >>= 1;
        while (i) t[i] = max(t[i << 1], t[(i << 1) | 1]), i >>= 1;
    }
};

struct Fen {
    vector<int> t;
    int n;

    Fen(int x) {n = x;t.assign(n + 1, 0);}
    int sum(int r) {int ans = 0;for (; r > 0; r -= r & -r) ans += t[r];return ans;}
    int get(int l, int r) {return sum(r) - sum(l - 1);}
    void upd(int i, int x) {for (; i <= n; i += i & -i) t[i] += x;}
};

int n, m;
vector<int> a;
string s;

void solve() {
    int T;
    cin >> T;
    cin >> n >> m;

    int x1, x2;
    cin >> x1 >> x2;
    cin >> s;

    if (x1 == x2) {
        if (s[0] != s[1]) {
            cout << "Yes\n";
            if (T >= 2) cout << x1 << "\n";
            if (T == 3) {
                cout << "1\n";
                cout << "0 " << x1 << "\n";
            }
            return;
        }

        cout << "Yes\n";
        if (T >= 2) cout << m << "\n";
        if (T == 3) cout << "0\n";
        return;
    }

    int x3 = x1, x4 = x2;
    if (x1 < x2) {
    } else {
        swap(x1, x2);
        swap(s[0], s[1]);
    }

    int dist = 0;
    if (s[0] == 'L') {
        x3 = 0;
        dist = x1 - 1;
    } else {
    }

    if (s[1] == 'R') {
        x4 = m - 1;
        dist += m - x2;
    }

    dist += x2 - x1;
    if (dist & 1) {
        cout << "No\n";
        return;
    }

    cout << "Yes\n";
    if (T >= 2) cout << (x3 + x4) / 2 << "\n";
    if (T == 3) {
        cout << "1\n";
        cout << (dist + 1) / 2 << " " << (x3 + x4) / 2 << "\n";
    }
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    #ifdef LOCAL
    freopen("input.txt", "r", stdin);
    #endif

    int t = 1;
    // cin >> t;

    while (t--) solve();
}