// #pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx2")
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T;
    cin >> T;
    int n, m;
    cin >> n >> m;
    vector <int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    string s;
    cin >> s;
    bool isAns = true;
    ll ans = 0;
    for (int i = 1; i < n && isAns; ++i) {
        if (s[i - 1] == s[i]) {
            isAns = abs(a[i - 1] - a[i]) % 2 == 0;
            ans = max(ans, (ll) abs(a[i - 1] - a[i]));
        } else {
            isAns = (a[i - 1] + a[i]) % 2 == 0;
            ans = max(ans, min(a[i - 1] + a[i] - 2ll, 2ll*m - (a[i - 1] + a[i])));
        }
    }
    if (isAns) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }
    if (T == 1) {
        return 0;
    }
    cout << ans / 2 << "\n";
    return 0;
}