#include <bits/stdc++.h>
const int maxBufSize = (10000000);
using namespace std;
int n, m, ti;
int inv[500005], outv[500005], A[30];
vector<int> v[500005];
vector<pair<int, int> > in[500005];
char s[500005];
void dfs(int ind, int h) {
  ++ti;
  inv[ind] = ti;
  int i, j, a, b, c, len;
  pair<int, int> p;
  p.first = ti;
  p.second = A[s[ind - 1] - 'a'] ^ in[h].back().second;
  in[h].push_back(p);
  len = v[ind].size();
  for (i = 0; i <= len - 1; ++i) {
    dfs(v[ind][i], h + 1);
  }
  outv[ind] = ++ti;
  return;
}
int main() {
  int i, j, a, b, c, ind1, ind2, h;
  char ch;
  scanf("%d %d", &n, &m);
  for (i = 2; i <= n; ++i) {
    scanf("%d", &a);
    v[a].push_back(i);
  }
  for (i = 1; i <= n; ++i) {
    in[i].resize(1);
  }
  scanf("%s", &s);
  for (i = 0; i <= 29; ++i) {
    A[i] = (1 << i);
  }
  ti = 0;
  dfs(1, 1);
  for (i = 1; i <= m; ++i) {
    scanf("%d %d", &a, &h);
    ind1 = lower_bound(in[h].begin(), in[h].end(), make_pair(inv[a], -1)) -
           in[h].begin() - 1;
    ind2 = lower_bound(in[h].begin(), in[h].end(), make_pair(outv[a], -1)) -
           in[h].begin() - 1;
    c = in[h][ind2].second ^ in[h][ind1].second;
    c = c - (c & (-c));
    if (!c) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}
