#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0;
  char s = getchar();
  while (!isdigit(s)) s = getchar();
  while (isdigit(s)) x = x * 10 + s - '0', s = getchar();
  return x;
}
const int N = 5e5 + 5;
int n, q, ans[N];
char s[N];
vector<int> e[N];
vector<pair<int, int> > c[N];
int node, R[N], ls[N << 5], rs[N << 5], val[N << 5];
void ins(int l, int r, int p, int v, int &x) {
  x = ++node;
  if (l == r) return val[x] ^= 1 << v, void();
  int m = l + r >> 1;
  if (p <= m)
    ins(l, m, p, v, ls[x]);
  else
    ins(m + 1, r, p, v, rs[x]);
}
int merge(int x, int y) {
  if (!x || !y) return x | y;
  ls[x] = merge(ls[x], ls[y]);
  rs[x] = merge(rs[x], rs[y]);
  return val[x] ^= val[y], x;
}
int query(int l, int r, int p, int x) {
  if (l == r) return val[x];
  int m = l + r >> 1;
  if (p <= m) return query(l, m, p, ls[x]);
  return query(m + 1, r, p, rs[x]);
}
void dfs(int id, int d) {
  ins(1, n, d, s[id] - 'a', R[id]);
  for (int it : e[id]) dfs(it, d + 1), R[id] = merge(R[id], R[it]);
  for (pair<int, int> it : c[id])
    ans[it.second] = __builtin_popcount(query(1, n, it.first, R[id]));
}
int main() {
  cin >> n >> q;
  for (int i = 2; i <= n; i++) e[read()].push_back(i);
  scanf("%s", s + 1);
  for (int i = 1, v, h; i <= q; i++)
    v = read(), h = read(), c[v].push_back({h, i});
  dfs(1, 1);
  for (int i = 1; i <= q; i++) puts(ans[i] > 1 ? "No" : "Yes");
  return 0;
}
