#include <bits/stdc++.h>

#define int long long
using ll = long long;
using ld = long double;
using namespace std;

const int INF = 1e18, MAXN = 1e5, mod = 998244353;

void solve();

int gg;

signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int tt = 1;
    cin >> gg;
    // cin >> tt;
    while (tt--) {
        solve();
        cout << "\n";
    }
}


void solve() {
    int n, m;
    cin >> n >> m;
    vector<int> arr(n);
    string s;
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
    }
    cin >> s;
    bool check = true;
    for (int i = 1; i < n; i++) {
        if (abs(arr[i] - arr[i - 1]) == 1 && s[i - 1] == s[i]) {
            check = false;
        }
        if (abs(arr[i] - arr[i - 1]) == 1 && n == 2) {
            check = false;
        }
    }
    if (check) {
        cout << "Yes";
    } else {
        cout << "No";
    }
}
