#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 5;
vector<int> e[maxn];
struct node {
  int dep, id;
};
vector<struct node> q[maxn];
int son[maxn];
int sz[maxn];
bool res[maxn];
int c[maxn];
bool tag[maxn];
int dep[maxn];
char s[maxn];
void dfs1(int u, int fa) {
  sz[u] = 1;
  dep[u] = dep[fa] + 1;
  son[u] = 0;
  for (auto v : e[u]) {
    if (v == fa) continue;
    dfs1(v, u);
    sz[u] += sz[v];
    if (sz[v] > sz[son[u]]) son[u] = v;
  }
}
void update(int u) {
  int i = s[u] - 'a';
  int d = dep[u];
  c[d] ^= (1 << i);
}
void dfs3(int u, int fa) {
  update(u);
  for (auto v : e[u]) {
    if (v == fa || tag[v]) continue;
    dfs3(v, u);
  }
}
bool bitcount(int x) {
  int res = 0;
  for (int i = 31; i >= 0; i--)
    if ((x >> i) & 1) res++;
  return res <= 1;
}
void work(int u) {
  for (auto t : q[u]) {
    int d = t.dep;
    int id = t.id;
    if (bitcount(c[d]))
      res[id] = true;
    else
      res[id] = false;
  }
}
void dfs2(int u, int fa, bool f) {
  for (auto v : e[u]) {
    if (v == fa || v == son[u]) continue;
    dfs2(v, u, false);
  }
  if (son[u]) dfs2(son[u], u, true), tag[son[u]] = true;
  dfs3(u, fa);
  work(u);
  if (son[u]) tag[son[u]] = false;
  if (f == false) dfs3(u, fa);
}
int main(void) {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 2; i <= n; i++) {
    int fa;
    scanf("%d", &fa);
    e[fa].push_back(i);
  }
  scanf("%s", s + 1);
  for (int i = 1; i <= m; i++) {
    int v, d;
    scanf("%d%d", &v, &d);
    q[v].push_back((node){d, i});
  }
  dep[0] = 0;
  dfs1(1, 0);
  dfs2(1, 0, true);
  for (int i = 1; i <= m; i++) printf("%s\n", res[i] ? "Yes" : "No");
  return 0;
}
