#include <bits/stdc++.h>
using namespace std;
using ii = pair<int, int>;
struct Query {
  int d, id;
};
int const maxn = 505050;
vector<int> v[maxn];
vector<int> childs[maxn];
vector<Query> qr[maxn];
int cnt[maxn][26];
int sz[maxn], d[maxn];
int cor[maxn];
bool res[maxn];
int dfs_size(int x) {
  sz[x] = 1;
  for (int u : v[x]) {
    d[u] = d[x] + 1;
    sz[x] += dfs_size(u);
  }
  return sz[x];
}
void add(int x) { cnt[d[x]][cor[x]]++; }
void rem(int x) { cnt[d[x]][cor[x]]--; }
bool get(int dep) {
  int nimp = 0;
  for (int i = 0; i < 26 and nimp < 2; i++) {
    if (cnt[dep][i] & 1) nimp++;
  }
  return nimp < 2;
}
void solve(int x, bool heavy) {
  ii best{-1, 0};
  for (int u : v[x]) {
    best = max(best, ii{sz[u], u});
  }
  int big = best.second;
  for (int u : v[x]) {
    if (u == big) continue;
    solve(u, false);
  }
  if (big != 0) {
    solve(big, true);
    swap(childs[big], childs[x]);
  }
  add(x);
  childs[x].push_back(x);
  for (int u : v[x]) {
    if (u == big) continue;
    for (int w : childs[u]) {
      add(w);
      childs[x].push_back(w);
    }
  }
  for (auto q : qr[x]) {
    res[q.id] = get(q.d);
  }
  if (!heavy) {
    for (int u : childs[x]) {
      rem(u);
    }
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(nullptr);
  int n, q;
  cin >> n >> q;
  for (int i = 2; i <= n; i++) {
    int p;
    cin >> p;
    v[p].push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    char a;
    cin >> a;
    cor[i] = a - 'a';
  }
  dfs_size(1);
  for (int i = 0; i < q; i++) {
    int vi, hi;
    cin >> vi >> hi;
    qr[vi].push_back(Query{hi - 1, i});
  }
  solve(1, true);
  for (int i = 0; i < q; i++) {
    if (res[i])
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
