#include <bits/stdc++.h>
using namespace std;
const int MXN = 5e5;
int n, m, k;
vector<vector<int>> chd;
vector<vector<pair<int, int>>> qry;
string chr;
vector<int> sz, dep, cnt;
vector<int>* sub[MXN];
vector<vector<int>> dp;
vector<bool> res;
bool ask(int d) {
  if (d >= k) return true;
  int odd = 0;
  for (int x : dp[d]) {
    if (x & 1) odd++;
  }
  return odd <= 1;
}
void dfa(int cur, int d) {
  dep[cur] = d++;
  k = max(k, d);
  for (int x : chd[cur]) {
    dfa(x, d);
    sz[cur] += sz[x];
  }
  sz[cur]++;
}
void dfs(int cur, bool keep) {
  int mx = -1, big = -1;
  for (int x : chd[cur]) {
    if (mx < sz[x]) {
      big = x;
      mx = sz[x];
    }
  }
  for (int x : chd[cur]) {
    if (x != big) dfs(x, 0);
  }
  if (big != -1) {
    dfs(big, 1);
    sub[cur] = sub[big];
  } else
    sub[cur] = new vector<int>();
  sub[cur]->push_back(cur);
  dp[dep[cur]][chr[cur]]++;
  for (int x : chd[cur]) {
    if (x == big) continue;
    for (int y : *sub[x]) {
      sub[cur]->push_back(y);
      dp[dep[y]][chr[y]]++;
    }
  }
  for (auto qq : qry[cur]) {
    int d = qq.first;
    int id = qq.second;
    res[id] = ask(d);
  }
  if (!keep) {
    for (int x : *sub[cur]) {
      dp[dep[x]][chr[x]]--;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  chd = vector<vector<int>>(n);
  for (int i = 1; i < n; i++) {
    int x;
    cin >> x;
    chd[--x].push_back(i);
  }
  cin >> chr;
  for (char& c : chr) c -= 'a';
  qry = vector<vector<pair<int, int>>>(n);
  for (int i = 0; i < m; i++) {
    int x, d;
    cin >> x >> d;
    qry[--x].push_back({--d, i});
  }
  k = 0;
  sz = vector<int>(n);
  dep = vector<int>(n);
  dfa(0, 0);
  dp = vector<vector<int>>(k, vector<int>(26));
  res = vector<bool>(m);
  cnt = vector<int>(n + 1);
  dfs(0, 1);
  for (int i = 0; i < m; i++) {
    cout << (res[i] ? "Yes" : "No") << '\n';
  }
}
