#include <bits/stdc++.h>
using namespace std;
vector<int> vec[500005], *sub[500005];
int sz[500005], lev[500005], cnt[500005], col[500005], ans[500005];
struct query {
  int h, idx;
  query() {}
  query(int h, int idx) : h(h), idx(idx) {}
};
vector<query> qrs[500005];
void pre(int s, int par) {
  int i, j;
  lev[s] = lev[par] + 1;
  sz[s] = 1;
  for (i = 0; i < vec[s].size(); i++) {
    j = vec[s][i];
    if (j == par) continue;
    pre(j, s);
    sz[s] += sz[j];
  }
  return;
}
void dfs(int s, int par, int keep) {
  int i, j, k, p, q, x, y, big = -1, mx = -1;
  for (i = 0; i < vec[s].size(); i++) {
    j = vec[s][i];
    if (j == par) continue;
    if (sz[j] > mx) mx = sz[j], big = j;
  }
  for (i = 0; i < vec[s].size(); i++) {
    j = vec[s][i];
    if (j == par || j == big) continue;
    dfs(j, s, 0);
  }
  if (big == -1)
    sub[s] = new vector<int>();
  else
    dfs(big, s, 1), sub[s] = sub[big];
  sub[s]->push_back(s);
  cnt[lev[s]] ^= (1 << col[s]);
  for (i = 0; i < vec[s].size(); i++) {
    j = vec[s][i];
    if (j == par || j == big) continue;
    for (auto it : *sub[j]) {
      sub[s]->push_back(it);
      cnt[lev[it]] ^= (1 << col[it]);
    }
  }
  for (i = 0; i < qrs[s].size(); i++) ans[qrs[s][i].idx] = cnt[qrs[s][i].h];
  if (keep == 0) {
    for (auto it : *sub[s]) cnt[lev[it]] ^= (1 << col[it]);
  }
  return;
}
bool cck(int x) {
  if (x == 0) return true;
  return (x & (x - 1)) == 0;
}
int main() {
  int n, m, i, j, k, p, q, x, y;
  string str;
  scanf("%d %d", &n, &m);
  for (i = 2; i <= n; i++) {
    scanf("%d", &p);
    vec[i].push_back(p);
    vec[p].push_back(i);
  }
  cin >> str;
  for (i = 0; i < str.size(); i++) col[i + 1] = str[i] - 'a';
  for (i = 1; i <= m; i++) {
    scanf("%d %d", &x, &y);
    qrs[x].push_back(query(y, i));
  }
  pre(1, 0);
  dfs(1, 0, 0);
  for (i = 1; i <= m; i++) printf("%s\n", cck(ans[i]) ? "Yes" : "No");
  return 0;
}
