#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const int N = 500100;
int n, ANS[N], q, dep[N];
char s[N];
set<pair<int, int> > se[N];
vector<int> adj[N];
vector<pair<int, int> > Q[N];
void mrg(set<pair<int, int> >& a, set<pair<int, int> >& b) {
  if (a.size() < b.size()) swap(a, b);
  for (auto x : b) {
    int dep = x.first, msk = x.second;
    auto it = a.lower_bound(make_pair(dep, -1));
    if (it == a.end() || (*it).first != dep) {
      a.insert(x);
    } else {
      int msk2 = (*it).second;
      msk ^= msk2;
      a.erase(it);
      a.insert({dep, msk});
    }
  }
}
void dfs(int u, int par) {
  dep[u] = dep[par] + 1;
  se[u].insert({dep[u], (1 << (s[u] - 'a'))});
  for (auto v : adj[u]) {
    if (v == par) continue;
    dfs(v, u);
    mrg(se[u], se[v]);
  }
  for (auto x : Q[u]) {
    if (dep[u] > x.second) {
      ANS[x.first] = -1;
      continue;
    }
    auto it = se[u].lower_bound(make_pair(x.second, -1));
    int msk = (*it).second;
    ANS[x.first] = msk;
  }
}
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 2; i <= n; i++) {
    int x;
    scanf("%d", &x);
    adj[x].push_back(i);
    adj[i].push_back(x);
  }
  scanf("%s", s + 1);
  for (int i = 1; i <= q; i++) {
    int v, d;
    scanf("%d %d", &v, &d);
    Q[v].push_back({i, d});
  }
  dfs(1, 0);
  for (int i = 1; i <= q; i++) {
    if (ANS[i] == -1 || __builtin_popcount(ANS[i]) <= 1)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
