// #pragma GCC optimize("Ofast,inline,unroll-loops")
// #pragma GCC target("avx2,popcnt")
#include <bits/stdc++.h>
#include  <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;

using ll = long long;
using ld = long double;
using uint = unsigned int;

using oset = tree<ll, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update>;

#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) (ll)(x.size())

template<typename T>
void sort(T &s) {
    sort(all(s));
}

template<typename T>
void rsort(T &s) {
    sort(rall(s));
}

mt19937 rnd(264);

const ll inf = 2e9 + 2000;
const ll infll = 2e18 + 2000;
const ll st_R = 19;
const ll R = (1 << st_R);
const ll mod = 998244353;

struct Mod {
    ll x = 0;
    Mod (ll x) : x(x) {}
    Mod () = default;

    Mod operator + (const Mod o) const {
        if (x + o.x >= mod) {
            return x + o.x - mod;
        }
        return x + o.x;
    }

    Mod operator - (const Mod o) const {
        if (x - o.x < 0) {
            return x - o.x + mod;
        }
        return x - o.x;
    }

    Mod operator * (const Mod o) const {
        return ll(x) * ll(o.x) % ll(mod);
    }
};

Mod st(Mod x, ll a) {
    Mod res = 1;
    while (a) {
        if (a & 1) {
            res = res * x;
        }
        x = x * x;
        a /= 2;
    }
    return res;
}

template<typename T>
struct poll {
    T x, y;
    poll(T x, T y) : x(x), y(y) {}
    poll(poll a, poll b) : x(b.x - a.x), y(b.y - a.y) {}

    poll operator + (const poll o) const {
        return {x + o.x, y + o.y};
    }

    poll operator - (const poll o) const {
        return {x - o.x, y - o.y};
    }

    T operator * (const poll o) const {
        return x * o.x + y * o.y;
    }

    T operator % (const poll o) const {
        return x * o.y - y * o.x;
    }

    T len2() {
        return x * x + y * y;
    }

    ld len() {
        return sqrt(x * x + y * y);
    }
};

using Poll = poll<ll>;
using Vector = poll<ll>;

struct Line {
    ld a, b, c;
    Line(ld a, ld b, ld c) : a(a), b(b), c(c) {}
    Line(Poll p1, Poll p2) : a(p1.y - p2.y), b(p2.x - p1.x), c(p1.x * p2.y - p2.x * p1.y) {}
};

struct Circle {
    Poll c;
    ld r;
    Circle(Poll c, ld r) : c(c), r(r) {}
};


ll n, m;


void solve() {
    ll t;
    cin >> t;

    cin >> n >> m;
    vector<ll> a(n);
    for (auto &i : a) {
        cin >> i;
    }
    string s;
    cin >> s;

    ll st = a[0] % 2;
    for (ll i = 0; i < n; ++i) {
        if (a[i] % 2 != st) {
            cout << "No";
            return;
        }
    }

    cout << "Yes\n";
    if (t == 1) {
        return;
    }
    set<ll> se;
    for (ll i = 0; i < n; ++i) {
        se.emplace(a[i]);
    }

    if (sz(se) == 1) {
        cout << m << "\n";
        if (t == 2) {
            return;
        }
        cout << 0 << "\n";
        return;
    }
    
    

    for (int i = 0; 1; ++i) {
        if (s[0] == 'R') {
            ++a[0];
        } else {
            --a[0];
        }
        if (s[1] == 'R') {
            ++a[1];
        } else {
            --a[1];
        }

        if (a[0] == 1) {
            s[0] = 'R';
        } else if (a[0] == m) {
            s[0] = 'L';
        }

        if (a[1] == 1) {
            s[1] = 'R';
        } else if (a[1] == m) {
            s[1] = 'L';
        }

        if (a[1] == a[0]) {
            cout << a[1] << "\n";
            if (t == 2) {
                return;
            }

            cout << i + 1 << ' ' << a[1] << "\n";
            return;
        }
    }
}

signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    ll tt = 1;
    // cin >> tt;

    while (tt--) {
        solve();
    }
}
