#include <bits/stdc++.h>
using namespace std;
int n, m, st[500005], en[500005], sld, dep[500005];
string s;
vector<int> ke[500005];
vector<vector<int> > dosau_pr[500005];
vector<int> dosau_vt[500005];
void dfs(int u) {
  st[u] = ++sld;
  int siz = dosau_vt[dep[u]].size();
  dosau_vt[dep[u]].push_back(sld);
  dosau_pr[dep[u]].push_back(vector<int>(26, 0));
  dosau_pr[dep[u]][siz][s[u]]++;
  for (int i = 0, _b = 26; i < _b; i++)
    dosau_pr[dep[u]][siz][i] += dosau_pr[dep[u]][siz - 1][i];
  for (auto v : ke[u]) {
    dep[v] = dep[u] + 1;
    dfs(v);
  }
  en[u] = sld;
}
void Solve() {
  cin >> n >> m;
  for (int i = 2, _b = n; i <= _b; i++) {
    int p;
    cin >> p;
    ke[p].push_back(i);
  }
  cin >> s;
  s = " " + s;
  for (int i = 1, _b = n; i <= _b; i++) dosau_vt[i].push_back(0);
  for (int i = 1, _b = n; i <= _b; i++)
    dosau_pr[i].push_back(vector<int>(26, 0));
  for (int i = 1, _b = n; i <= _b; i++) s[i] -= 'a';
  dep[1] = 1;
  dfs(1);
  for (int te = 1, _b = m; te <= _b; te++) {
    int u, ds;
    cin >> u >> ds;
    if (dep[u] >= ds) {
      cout << "Yes\n";
      continue;
    }
    int dau = lower_bound(dosau_vt[ds].begin(), dosau_vt[ds].end(), st[u]) -
              dosau_vt[ds].begin();
    dau--;
    int cuoi = upper_bound(dosau_vt[ds].begin(), dosau_vt[ds].end(), en[u]) -
               dosau_vt[ds].begin();
    cuoi--;
    int tmp = 0;
    for (int i = 0, _b = 26; i < _b; i++)
      tmp += (dosau_pr[ds][cuoi][i] - dosau_pr[ds][dau][i]) % 2;
    if (tmp < 2)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int Test_numbers = 1;
  while (Test_numbers--) Solve();
  return 0;
}
