#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int f = 1, num = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) num = (num << 1) + (num << 3) + ch - '0', ch = getchar();
  return num * f;
}
int tot, head[5000003], nxt[1000003], to[1000003];
int sz[500003], son[500003], dis[500003], dep[500003], fa[500003];
int n, m;
char a[500003];
inline void addedge(int x, int y) {
  nxt[++tot] = head[x], head[x] = tot, to[tot] = y;
}
void dfs1(int x) {
  sz[x] = 1;
  for (int i = head[x]; i; i = nxt[i]) {
    int y = to[i];
    if (y == fa[x]) continue;
    fa[y] = x, dep[y] = dep[x] + 1, dfs1(y), sz[x] += sz[y];
    if (sz[y] > sz[son[x]]) son[x] = y;
  }
  return;
}
int st[500003], ans[500003];
int qwqwq;
void calc(int x, int fa, int op) {
  st[dep[x]] ^= (1 << (a[x] - 'a'));
  for (int i = head[x]; i; i = nxt[i])
    if (to[i] != fa && to[i] != qwqwq) calc(to[i], x, op);
}
vector<pair<int, int> > v[500003];
void solve(int x, int fa, int op) {
  for (int i = head[x]; i; i = nxt[i])
    if (to[i] != fa && to[i] != son[x]) solve(to[i], x, 0);
  if (son[x]) solve(son[x], x, 1), qwqwq = son[x];
  calc(x, fa, 1);
  qwqwq = 0;
  for (auto q : v[x])
    ans[q.first] = (__builtin_popcount(st[q.second - 1]) <= 1);
  if (!op) calc(x, fa, 0);
}
signed main() {
  n = read(), m = read();
  for (int i = 2, x, y; i <= n; ++i)
    x = read(), y = i, addedge(x, y), addedge(y, x);
  scanf("%s", a + 1);
  for (int i = 1, x; i <= m; ++i)
    x = read(), v[x].push_back(make_pair(i, read()));
  dfs1(1), solve(1, 0, 0);
  for (int i = 1; i <= m; ++i) puts(ans[i] ? "Yes" : "No");
  return 0;
}
