#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
int read() {
  char c = getchar();
  int x = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
int n, a[N], Q, x;
char s[N];
vector<pair<int, long long> > q[N];
int ans[N];
struct edge {
  int v, ne;
} e[N << 1];
int cnt, h[N];
inline void ins(int u, int v) {
  e[++cnt] = (edge){v, h[u]};
  h[u] = cnt;
}
int size[N], mx[N], deep[N], big[N];
void dfs(int u) {
  size[u] = 1;
  for (int i = h[u]; i; i = e[i].ne) {
    deep[e[i].v] = deep[u] + 1;
    dfs(e[i].v);
    size[u] += size[e[i].v];
    if (size[e[i].v] > size[mx[u]]) mx[u] = e[i].v;
  }
}
pair<int, long long> f[N];
void update(int u, int val) {
  f[deep[u]].first += val;
  f[deep[u]].second ^= (1 << (a[u]));
  for (int i = h[u]; i; i = e[i].ne)
    if (!big[e[i].v]) update(e[i].v, val);
}
inline int one(int n) {
  int ans = 0;
  while (n) n &= (n - 1), ans++;
  return ans;
}
inline int cal(int d) {
  return f[d].second == 0 || (one(f[d].second) == 1 && (f[d].first & 1));
}
void dfs(int u, int keep) {
  for (int i = h[u]; i; i = e[i].ne)
    if (e[i].v != mx[u]) dfs(e[i].v, 0);
  if (mx[u]) dfs(mx[u], 1), big[mx[u]] = 1;
  update(u, 1);
  for (int i = 0; i < (int)q[u].size(); i++)
    ans[q[u][i].second] = cal(q[u][i].first);
  big[mx[u]] = 0;
  if (!keep) update(u, -1);
}
int main() {
  n = read();
  Q = read();
  for (int i = 2; i <= n; i++) ins(read(), i);
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++) a[i] = s[i] - 'a';
  for (int i = 1; i <= Q; i++) x = read(), q[x].push_back(make_pair(read(), i));
  deep[1] = 1;
  dfs(1);
  dfs(1, 1);
  for (int i = 1; i <= Q; i++) puts(ans[i] ? "Yes" : "No");
}
