#include <bits/stdc++.h>
using namespace std;
const int maxN = 5e5 + 10;
vector<pair<int, int> > queries[maxN];
int n, q, res[maxN], cnt[maxN], d[maxN];
vector<int> adj[maxN];
char s[maxN];
void dfs(int u) {
  for (auto p : queries[u]) res[p.second] ^= cnt[p.first];
  for (int v : adj[u]) d[v] = d[u] + 1, dfs(v);
  cnt[d[u]] ^= (1 << (s[u] - 'a'));
  for (auto p : queries[u]) {
    res[p.second] ^= cnt[p.first];
    res[p.second] &= (res[p.second] - 1);
  }
}
int main() {
  scanf("%d %d\n", &n, &q);
  for (int i = 2; i <= n; ++i) {
    int p;
    scanf("%d", &p);
    adj[p].push_back(i);
  }
  scanf("\n%s\n", s + 1);
  for (int i = 0; i < q; ++i) {
    int v, h;
    scanf("%d %d", &v, &h);
    queries[v].push_back({h, i});
  }
  d[1] = 1;
  dfs(1);
  for (int i = 0; i < q; ++i) printf("%s\n", (res[i] ? "No" : "Yes"));
}
