#include <bits/stdc++.h>
using namespace std;
int n, m, tot = 0, fa[500005], son[500005], dep[500005], size[500005],
          cnt[500005][26], st[500005];
bool ans[500005];
string a;
struct record {
  int x, d;
};
vector<record> b[500005];
struct edge {
  int to, nxt;
} e[500005];
void add(int x, int y) {
  e[++tot].to = y;
  e[tot].nxt = st[x];
  st[x] = tot;
}
void dfs1(int x) {
  int i;
  size[x] = 1;
  for (i = st[x]; i; i = e[i].nxt) {
    fa[e[i].to] = x;
    dep[e[i].to] = dep[x] + 1;
    dfs1(e[i].to);
    size[x] += size[e[i].to];
    if (size[e[i].to] > size[son[x]]) son[x] = e[i].to;
  }
}
void update(int x) {
  int i;
  cnt[dep[x]][a[x] - 97]++;
  for (i = st[x]; i; i = e[i].nxt) update(e[i].to);
}
void del(int x) {
  int i;
  cnt[dep[x]][a[x] - 97]--;
  for (i = st[x]; i; i = e[i].nxt) del(e[i].to);
}
void dfs2(int x) {
  int i, j, y, sz;
  for (i = st[x]; i; i = e[i].nxt)
    if (e[i].to ^ son[x]) dfs2(e[i].to), del(e[i].to);
  if (son[x]) dfs2(son[x]);
  cnt[dep[x]][a[x] - 97]++;
  for (i = st[x]; i; i = e[i].nxt)
    if (e[i].to ^ son[x]) update(e[i].to);
  for (i = 0, sz = b[x].size(); i < sz; i++) {
    y = 0;
    for (j = 0; j < 26; j++)
      if (cnt[b[x][i].x][j] & 1) y++;
    ans[b[x][i].d] = bool(y <= 1);
  }
}
int main() {
  int i, x, y;
  scanf("%d%d", &n, &m);
  for (i = 2; i <= n; i++) scanf("%d", &x), add(x, i);
  cin >> a;
  a = ' ' + a;
  fa[1] = 0;
  dep[1] = 1;
  dfs1(1);
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &x, &y);
    b[x].push_back((record){y, i});
  }
  dfs2(1);
  for (i = 1; i <= m; i++) printf("%s\n", ans[i] ? "Yes" : "No");
  return 0;
}
