#include <bits/stdc++.h>
using namespace std;
int N, M, pt, ptq, x;
long long sum[500010];
char str[500010];
int qst[500010], qne[500010];
int st[500010], ne[500010], go[500010];
class que {
 public:
  int x, h;
  long long ans;
} Q[500010];
void dfs(int x, int dep) {
  for (int i = qst[x]; i; i = qne[i]) Q[i].ans = sum[Q[i].h];
  sum[dep] ^= 1ll << (str[x] - 'a');
  for (int i = st[x]; i; i = ne[i]) dfs(go[i], dep + 1);
  for (int i = qst[x]; i; i = qne[i]) Q[i].ans ^= sum[Q[i].h];
}
void Add(int x, int y) {
  ne[++pt] = st[x];
  st[x] = pt;
  go[pt] = y;
}
void Addq(int x) {
  qne[++ptq] = qst[x];
  qst[x] = ptq;
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 2; i <= N; i++) scanf("%d", &x), Add(x, i);
  scanf("%s", str + 1);
  for (int i = 1; i <= M; i++) {
    scanf("%d%d", &Q[i].x, &Q[i].h);
    Addq(Q[i].x);
  }
  dfs(1, 1);
  for (int i = 1; i <= M; i++)
    if (Q[i].ans == (Q[i].ans & -Q[i].ans))
      printf("Yes\n");
    else
      printf("No\n");
}
