#include <bits/stdc++.h>
using namespace std;
int n, m, ent = 1;
vector<int> alt[500009];
int pr[500009], open[500009], close[500009], hs[500009], A[31];
char deg[500009];
vector<pair<int, int>> H[500009];
void dfs(int x, int h) {
  hs[x] = h;
  open[x] = ent++;
  H[h].push_back(make_pair(ent, H[h].back().second ^ A[deg[x] - 'a']));
  for (int i = 0; i < alt[x].size(); i++) dfs(alt[x][i], h + 1);
  close[x] = ent++;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i <= 30; i++) A[i] = 1 << i;
  for (int i = 1; i <= n; i++) H[i].resize(1);
  for (int i = 2; i <= n; i++) {
    scanf("%d", &pr[i]);
    alt[pr[i]].push_back(i);
  }
  for (int i = 1; i <= n; i++) scanf(" %c", &deg[i]);
  dfs(1, 1);
  for (int i = 1; i <= m; i++) {
    int v, h;
    scanf("%d%d", &v, &h);
    int l = lower_bound(H[h].begin(), H[h].end(), make_pair(open[v], -1)) -
            H[h].begin();
    int r = lower_bound(H[h].begin(), H[h].end(), make_pair(close[v], -1)) -
            H[h].begin();
    int t = H[h][l - 1].second ^ H[h][r - 1].second;
    bool ok = t - (t & -t);
    if (!ok)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
