#include <bits/stdc++.h>
using namespace std;
const int maxN = 5e5 + 10;
int n, q, num_map, map_idx[maxN], res[maxN], d[maxN];
vector<pair<int, int> > queries[maxN];
vector<int> pool, adj[maxN];
unordered_map<int, int> dmap[maxN];
char s[maxN];
void add_to_pool(int idx) {
  dmap[idx].clear();
  pool.push_back(idx);
}
int get_from_pool() {
  if (pool.empty()) pool.push_back(++num_map);
  int idx = pool.back();
  pool.pop_back();
  return idx;
}
void dfs(int u) {
  for (int v : adj[u]) {
    d[v] = d[u] + 1;
    dfs(v);
    if (map_idx[u] == 0 || dmap[map_idx[u]].size() < dmap[map_idx[v]].size())
      map_idx[u] = map_idx[v];
  }
  if (map_idx[u] == 0) map_idx[u] = get_from_pool();
  auto& curr_map = dmap[map_idx[u]];
  for (int v : adj[u]) {
    if (map_idx[u] == map_idx[v]) continue;
    for (auto& p : dmap[map_idx[v]]) curr_map[p.first] ^= p.second;
    add_to_pool(map_idx[v]);
  }
  curr_map[d[u]] ^= (1 << (s[u] - 'a'));
  for (auto p : queries[u]) {
    res[p.second] = curr_map[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"));
}
