#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000000 + 11;
int n, m, x, y, size, k, L, R, mid, l, r, cnt, h, Lv[maxn], Rv[maxn],
    depth[maxn], a[maxn], dep;
vector<int> v[maxn], val[maxn], G[maxn];
char s[maxn];
bool cmp(int x, int y) { return Lv[x] < Lv[y]; }
void trans(int k, int dep) {
  depth[k] = dep, Lv[k] = ++size;
  for (int i = 0; i <= (int)(G[k].size()) - 1; i++) trans(G[k][i], dep + 1);
  Rv[k] = size;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 2; i <= n; i++) {
    scanf("%d", &x);
    G[x].push_back(i);
  }
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++) a[i] = (int)(s[i] - 'a' + 1);
  size = 0;
  trans(1, 1);
  for (int i = 1; i <= n; i++) v[depth[i]].push_back(i), h = max(h, depth[i]);
  for (int i = 1; i <= h; i++) {
    sort(v[i].begin(), v[i].end(), cmp);
    val[i].push_back(1 << (a[v[i][0]]));
    for (int j = 1; j <= (int)(v[i].size()) - 1; j++)
      val[i].push_back(val[i].back() ^ (1 << (a[v[i][j]])));
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &x, &dep);
    if (depth[x] > dep) {
      printf("Yes\n");
      continue;
    }
    if (v[dep].empty()) {
      printf("Yes\n");
      continue;
    }
    if (Lv[x] > Lv[v[dep].back()]) {
      printf("Yes\n");
      continue;
    }
    if (Rv[x] < Rv[v[dep].front()]) {
      printf("Yes\n");
      continue;
    }
    L = 0, R = (int)(v[dep].size()) - 1;
    while (L < (R - 1)) {
      mid = (L + R) >> 1;
      if (Lv[v[dep][mid]] < Lv[x])
        L = mid + 1;
      else
        R = mid;
    }
    if (Lv[v[dep][L]] >= Lv[x])
      l = L;
    else
      l = R;
    L = 0, R = (int)(v[dep].size()) - 1;
    while (L < (R - 1)) {
      mid = (L + R) >> 1;
      if (Rv[v[dep][mid]] > Rv[x])
        R = mid - 1;
      else
        L = mid;
    }
    if (Rv[v[dep][R]] <= Rv[x])
      r = R;
    else
      r = L;
    cnt = 0, k = val[dep][r] ^ ((l == 0) ? (0) : val[dep][l - 1]);
    for (int i = 1; i <= 26; i++)
      if (k & (1 << i)) cnt++;
    if (cnt <= 1)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
