#include <bits/stdc++.h>
using namespace std;
int n, m;
int ci[110];
char s[500500];
int depth[500500];
struct query {
  int id, u, d, ans;
} Q[500500];
vector<int> G[500010];
int son[500010], sz[500010];
vector<query> q[500500];
void dfs1(int u, int f, int d) {
  depth[u] = d;
  sz[u] = 1;
  son[u] = 0;
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    if (v == f) continue;
    dfs1(v, u, d + 1);
    sz[u] += sz[v];
    if (sz[v] > sz[son[u]]) {
      son[u] = v;
    }
  }
  return;
}
int mx;
long long sum;
int Son;
int tot[500500][27];
void dfs2(int u, int f, int val) {
  tot[depth[u]][s[u] - 'a'] += val;
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    if (v == f || v == Son) continue;
    dfs2(v, u, val);
  }
  return;
}
void cal(int u, int f, int tp) {
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    if (v == f || v == son[u]) continue;
    cal(v, u, 0);
  }
  if (son[u]) cal(son[u], u, 1), Son = son[u];
  dfs2(u, f, 1);
  Son = 0;
  for (int i = 0; i < q[u].size(); i++) {
    query p = q[u][i];
    int res = 0;
    for (int j = 0; j < 26; j++) {
      if (tot[p.d][j] % 2 == 1) {
        res++;
      }
    }
    if (res <= 1) {
      Q[p.id].ans = 1;
    } else {
      Q[p.id].ans = 0;
    }
  }
  if (!tp) {
    dfs2(u, f, -1);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 2; i <= n; i++) {
    int u;
    scanf("%d", &u);
    G[u].push_back(i);
    G[i].push_back(u);
  }
  scanf("%s", s + 1);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &Q[i].u, &Q[i].d);
    Q[i].id = i;
    q[Q[i].u].push_back(Q[i]);
  }
  dfs1(1, 0, 1);
  cal(1, 0, 1);
  for (int i = 1; i <= m; i++) {
    if (Q[i].ans) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}
