#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 9;
int n, cnt, m;
int dep[N];
int ans[N];
int son[N], sz[N];
int last[N];
int c[N][26];
char v[N];
struct edge {
  int pre, to;
} e[N * 2];
struct node {
  int id, d;
};
vector<node> que[N];
inline void add(int x, int y) {
  e[++cnt] = (edge){last[x], y};
  last[x] = cnt;
}
inline int read() {
  int f = 1, x = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return f * x;
}
inline void init() {
  n = read(), m = read();
  for (int i = 2; i <= n; i++) add(read(), i);
  scanf("%s", v + 1);
  for (int i = 1; i <= m; i++) {
    int x = read(), d = read();
    que[x].push_back((node){i, d});
  }
}
inline void addd(int x, int k) {
  c[dep[x]][v[x] - 'a' + 1] += k;
  return;
}
inline bool check(int x, int d) {
  int res = 0;
  for (int i = 1; i <= 26; i++) res += c[d][i] & 1;
  return res <= 1;
}
void update(int x, int k) {
  addd(x, k);
  for (int i = last[x]; i; i = e[i].pre) {
    int to = e[i].to;
    update(to, k);
  }
  return;
}
void dfs(int x, int fa) {
  dep[x] = dep[fa] + 1;
  for (int i = last[x]; i; i = e[i].pre) {
    int to = e[i].to;
    dfs(to, x);
    sz[x] += sz[to];
    if (sz[son[x]] < sz[to]) son[x] = to;
  }
  sz[x]++;
  return;
}
void dfs1(int x, int fa, bool top) {
  for (int i = last[x]; i; i = e[i].pre) {
    int to = e[i].to;
    if (to == son[x]) continue;
    dfs1(to, x, true);
  }
  if (son[x]) dfs1(son[x], x, false);
  for (int i = last[x]; i; i = e[i].pre) {
    int to = e[i].to;
    if (to == son[x]) continue;
    update(to, 1);
  }
  addd(x, 1);
  for (int i = 0; i < que[x].size(); i++) {
    int d = que[x][i].d;
    ans[que[x][i].id] = check(x, d);
  }
  if (top) update(x, -1);
  return;
}
int main() {
  init();
  dfs(1, 0);
  dfs1(1, 0, false);
  for (int i = 1; i <= m; i++) puts(ans[i] ? "Yes" : "No");
  return 0;
}
