#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 1;
vector<int> g[maxn];
int h[maxn], sz[maxn], n, q;
char s[maxn];
int sum[maxn], in[maxn], out[maxn], dfs_t, id[maxn];
void dfs(int cur) {
  sz[cur] = 1;
  in[cur] = ++dfs_t;
  id[dfs_t] = cur;
  for (auto nxt : g[cur]) {
    h[nxt] = h[cur] + 1;
    dfs(nxt);
    sz[cur] += sz[nxt];
  }
  out[cur] = dfs_t;
}
vector<pair<int, int> > query[maxn];
int ans[maxn];
void dfs(int cur, bool keep) {
  int son = 0;
  for (auto nxt : g[cur])
    if (sz[nxt] > sz[son]) son = nxt;
  for (auto nxt : g[cur])
    if (nxt != son) dfs(nxt, false);
  if (son) dfs(son, true);
  for (auto nxt : g[cur])
    if (nxt != son)
      for (int i = in[nxt]; i <= out[nxt]; ++i) {
        int tar = id[i];
        sum[h[tar]] ^= 1 << (s[tar - 1] - 'a');
      }
  sum[h[cur]] ^= 1 << (s[cur - 1] - 'a');
  for (auto e : query[cur]) {
    int bit = sum[e.first];
    ans[e.second] = bit == (bit & -bit);
  }
  if (!keep) {
    for (int i = in[cur]; i <= out[cur]; ++i) sum[h[id[i]]] = 0;
  }
}
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 2; i <= n; ++i) {
    int p;
    scanf("%d", &p);
    g[p].push_back(i);
  }
  scanf("%s", s);
  h[1] = 1;
  dfs(1);
  for (int i = 0; i < q; ++i) {
    int v, d;
    scanf("%d %d", &v, &d);
    query[v].push_back(make_pair(d, i));
  }
  dfs(1, 1);
  for (int i = 0; i < q; ++i) puts(ans[i] ? "Yes" : "No");
}
