#include <bits/stdc++.h>
using namespace std;

#define int long long
#define pb push_back
#define endl "\n"
using ll = long long;
using pii = pair<int, int>;
using ld = long double;

template <typename t>
istream& operator>>(istream &in, vector<t> &a){
    for (auto &el : a){
        in >> el;
    }
    return in;
}

template <typename t>
ostream& operator<<(ostream &out, vector<t> &a){
    for (auto &el : a){
        out << el << " ";
    }
    return out;
}



void solve(){
    int t;
    cin >> t;
    int n;
    cin >> n;
    int m;
    cin >> m;
    vector<int> a(n);
    int now = 0;
    for (int i = 0; i < n; ++i){
        cin >> a[i]; a[i]--;
        if (i == 0) now = a[i] % 2;
        if (now != a[i] % 2){
            cout << "No" << endl;
            return;
        }
    }
    if (t == 1){
        cout << "Yes" << endl;
        return;
    }
    vector<int> side(n);
    for (int i = 0; i < n; ++i){
        char c;
        cin >> c;
        if (c == 'L') side[i] = -1;
        else side[i] = 1;
    }
    assert(n == 2);
    cout << m / 2 << endl;
    return;
    auto move = [&] (int i, int k){
        if (side[i] == 1){
            // if ()
        }
    };
    if (side[0] == -1) {

    }
}



signed main(){
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    ios_base::sync_with_stdio(0); cin.tie(0);
#endif
    int t = 1;
    // cin >> t;
    while (t--) {
        solve();
    }
}   