#include <bits/stdc++.h>
using namespace std;
int n, m, fa[500005];
int V[500005], H[500005], ans[500005];
vector<int> G[500005], Q[500005];
char s[500005];
int len[500005], son[500005], tf[500005], *f[500005] = {tf}, dep[500005];
void dfs0(int u) {
  for (int v : G[u])
    dep[v] = dep[u] + 1, dfs0(v), (len[v] > len[son[u]]) && (son[u] = v);
  len[u] = len[son[u]] + 1;
}
void dfs1(int u) {
  if (son[u]) {
    f[son[u]] = f[u] + 1;
    dfs1(son[u]);
  }
  f[u][0] ^= 1 << (s[u] - 'a');
  for (int v : G[u])
    if (v != son[u]) {
      f[v] = f[0], f[0] += len[v];
      dfs1(v);
      for (int i = (1), LIM = (len[v]); i <= LIM; i++) f[u][i] ^= f[v][i - 1];
    }
  for (int v : Q[u]) {
    if (H[v] - dep[u] < len[u] && H[v] >= dep[u])
      ans[v] = (__builtin_popcount(f[u][H[v] - dep[u]]) <= 1);
    else
      ans[v] = 1;
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = (2), LIM = (n); i <= LIM; i++)
    scanf("%d", &fa[i]), G[fa[i]].push_back(i);
  scanf("%s", s + 1);
  for (int i = (1), LIM = (m); i <= LIM; i++) {
    scanf("%d%d", &V[i], &H[i]);
    Q[V[i]].push_back(i);
  }
  dep[1] = 1;
  dfs0(1);
  f[1] = f[0], f[0] += len[1];
  dfs1(1);
  for (int i = (1), LIM = (m); i <= LIM; i++) puts(ans[i] ? "Yes" : "No");
}
