#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
const int M = 1e5 + 5;
const long long Mod = 199999;
namespace FASTIO {
inline long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  return x * f;
}
void print(int x) {
  if (x < 0) {
    x = -x;
    putchar('-');
  }
  if (x > 9) print(x / 10);
  putchar(x % 10 + '0');
}
}  // namespace FASTIO
using namespace FASTIO;
void FRE() {}
int n, m, val[N], ssize[N], son[N], Son, dep[N], ans[N];
int cnt[N];
struct Query {
  int id, d;
};
vector<Query> vec[N];
vector<int> G[N];
char s[N];
void dfs(int u, int fa) {
  ssize[u] = 1, dep[u] = dep[fa] + 1;
  for (auto v : G[u]) {
    if (v == fa) continue;
    dfs(v, u);
    ssize[u] += ssize[v];
    if (ssize[v] > ssize[son[u]]) son[u] = v;
  }
}
void slove(int u, int fa) {
  cnt[dep[u]] ^= (1 << val[u]);
  for (auto v : G[u]) {
    if (v == fa || v == Son) continue;
    slove(v, u);
  }
}
int check(int d) {
  int sum = 0;
  for (register int i = 0; i < 26; ++i) sum += ((cnt[d] >> i) & 1);
  return sum;
}
void dfs1(int u, int fa, int opt) {
  for (auto v : G[u]) {
    if (v == fa || v == son[u]) continue;
    dfs1(v, u, 0);
  }
  if (son[u]) dfs1(son[u], u, 1), Son = son[u];
  slove(u, fa);
  Son = 0;
  for (auto t : vec[u]) {
    ans[t.id] = check(t.d);
  }
  if (opt == 0) slove(u, fa);
}
int main() {
  n = read(), m = read();
  for (register int i = 2; i <= n; ++i) {
    int par;
    par = read();
    G[i].push_back(par);
    G[par].push_back(i);
  }
  dfs(1, 0);
  scanf("%s", s);
  int len = strlen(s);
  for (register int i = 0; i < len; ++i) val[i + 1] = s[i] - 'a';
  for (register int i = 1; i <= m; ++i) {
    int v, h;
    v = read(), h = read();
    vec[v].push_back(Query{i, h});
  }
  dfs1(1, 0, 0);
  for (register int i = 1; i <= m; ++i)
    printf("%s\n", ans[i] <= 1 ? "Yes" : "No");
}
