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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, q;
    cin >> n >> q;
    vector<vector<int>> ch(n);
    for (int v = 1, p; v < n; v++) {
        cin >> p;
        ch[p - 1].push_back(v);
    }
    string s;
    cin >> s;
    vector<int> tin(n), tout(n), dep(n, 1);
    vector<vector<int>> pos(n + 2), pref(n + 2, vector<int>(1, 0));
    vector<pair<int, bool>> st{{0, false}};
    int timer = 0;
    while (!st.empty()) {
        auto [v, exit] = st.back();
        st.pop_back();
        if (exit) {
            tout[v] = timer;
            continue;
        }
        tin[v] = timer++;
        int d = dep[v];
        pos[d].push_back(tin[v]);
        pref[d].push_back(pref[d].back() ^ (1 << (s[v] - 'a')));
        st.push_back({v, true});
        for (auto it = ch[v].rbegin(); it != ch[v].rend(); ++it) {
            dep[*it] = d + 1;
            st.push_back({*it, false});
        }
    }
    while (q--) {
        int v, h;
        cin >> v >> h;
        --v;
        if (h > n) {
            cout << "Yes\n";
            continue;
        }
        int l = lower_bound(pos[h].begin(), pos[h].end(), tin[v]) - pos[h].begin();
        int r = lower_bound(pos[h].begin(), pos[h].end(), tout[v]) - pos[h].begin();
        int mask = pref[h][r] ^ pref[h][l];
        cout << ((mask & (mask - 1)) == 0 ? "Yes" : "No") << '\n';
    }
}
