#include <bits/stdc++.h>
using namespace std;
int n, m;
bool Ans[500005];
int res;
int T, L[500005], R[500005], mp[500005], sz[500005], son[500005], sum[500005],
    key[500005], dep[500005];
char A[500005];
vector<int> edge[500005];
struct node {
  int id, k;
};
vector<node> Q[500005];
int lowbit(int x) { return x & -x; }
void dfs(int x, int f) {
  L[x] = ++T, mp[T] = x;
  sz[x] = 1, son[x] = 0;
  for (int i = 0; i < edge[x].size(); i++) {
    int v = edge[x][i];
    if (v == f) continue;
    dep[v] = dep[x] + 1;
    dfs(v, x);
    sz[x] += sz[v];
    if (sz[v] > sz[son[x]]) son[x] = v;
  }
  R[x] = T;
}
void Add_point(int x) { key[dep[x]] ^= (1 << (A[x] - 'a')); }
void Add_tree(int x) {
  for (int i = L[x]; i <= R[x]; i++) {
    Add_point(mp[i]);
  }
}
void Redfs(int x, int f) {
  for (int i = 0; i < edge[x].size(); i++) {
    int y = edge[x][i];
    if (y == son[x] || y == f) continue;
    Redfs(y, x);
    Add_tree(y);
  }
  if (son[x]) Redfs(son[x], x);
  for (int i = 0; i < edge[x].size(); i++) {
    int y = edge[x][i];
    if (y == son[x] || y == f) continue;
    Add_tree(y);
  }
  Add_point(x);
  for (int i = 0; i < Q[x].size(); i++) {
    Ans[Q[x][i].id] = (key[Q[x][i].k] == lowbit(key[Q[x][i].k]));
  }
}
void Init() {
  T = 0, res = 0;
  for (int i = 0; i < 500005; i++) edge[i].clear(), Q[i].clear();
  return;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 2; i <= n; i++) {
    int a;
    scanf("%d", &a);
    edge[a].push_back(i);
  }
  scanf("%s", A + 1);
  dep[1] = 1;
  dfs(1, 0);
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    Q[a].push_back((node){i, b});
  }
  Redfs(1, 0);
  for (int i = 1; i <= m; i++) {
    if (Ans[i])
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
