#include <bits/stdc++.h>
using namespace std;
int n, m, tot, sz[500005], son[500005], dep[500005], fa[500005], L[500005],
    R[500005];
int LL[500005], ans[500005], cnt[500005], tt[500005];
vector<int> a[500005];
char c[500005];
struct data {
  int k, id;
};
vector<data> Q[500005];
void wch() {
  for (int i = 0; i <= n; i++) a[i].clear(), Q[i].clear();
  tot = 0;
}
void dfs(int x, int f) {
  dep[x] = dep[f] + 1;
  fa[x] = f;
  sz[x] = 1;
  L[x] = ++tot;
  LL[tot] = x;
  son[x] = 0;
  for (int i = 0; i < a[x].size(); i++) {
    int y = a[x][i];
    if (y == f) continue;
    dfs(y, x);
    sz[x] += sz[y];
    if (sz[son[x]] < sz[y]) son[x] = y;
  }
  R[x] = tot;
}
void Del(int x) {
  for (int i = L[x]; i <= R[x]; i++) {
    int y = LL[i];
    tt[dep[y]] ^= 1 << (c[y] - 'a');
  }
}
void Add(int x) {
  for (int i = L[x]; i <= R[x]; i++) {
    int y = LL[i];
    tt[dep[y]] ^= 1 << (c[y] - 'a');
  }
}
void solve(int x) {
  for (int i = 0; i < a[x].size(); i++) {
    int y = a[x][i];
    if (son[x] == y) continue;
    solve(y);
    Del(y);
  }
  if (son[x]) solve(son[x]);
  for (int i = 0; i < a[x].size(); i++) {
    int y = a[x][i];
    if (y == son[x]) continue;
    Add(y);
  }
  tt[dep[x]] ^= 1 << (c[x] - 'a');
  for (int i = 0; i < Q[x].size(); i++) {
    int y = Q[x][i].k;
    if (tt[y] != (tt[y] & -tt[y]))
      ans[Q[x][i].id] = 0;
    else
      ans[Q[x][i].id] = 1;
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 2; i <= n; i++) {
    int x;
    scanf("%d", &x);
    a[x].push_back(i);
  }
  scanf("%s", c + 1);
  dfs(1, 0);
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    Q[x].push_back((data){y, i});
  }
  solve(1);
  for (int i = 1; i <= m; i++)
    if (ans[i])
      puts("Yes");
    else
      puts("No");
  return 0;
}
