#include <bits/stdc++.h>
using namespace std;
int n, m, k, maxd;
int p[500005], d[500005];
int num[500005];
char letters[500005];
vector<int> v[500005], u[500005];
bool parity[26][500005];
void dfs(int x) {
  num[x] = ++k;
  u[d[x]].push_back(x);
  int ch = letters[x] - 'a';
  int pos = u[d[x]].size() - 1;
  for (int i = 0; i < 26; i++)
    parity[i][x] = (pos > 0) && parity[i][u[d[x]][pos - 1]];
  parity[ch][x] = (pos == 0) || !parity[ch][u[d[x]][pos - 1]];
  for (int i = 0; i < (int)v[x].size(); i++)
    if (num[v[x][i]] == 0) dfs(v[x][i]);
}
void init() {
  d[0] = 1;
  p[0] = -1;
  maxd = 1;
  for (int i = 1; i < n; i++) {
    d[i] = d[p[i]] + 1;
    maxd = max(maxd, d[i]);
  }
  k = 0;
  dfs(0);
}
bool comp(int i, int j) { return (num[i] < num[j]); }
bool query(int v, int h) {
  if (h <= d[v]) return true;
  if (h > maxd) return true;
  int pos =
      lower_bound(u[d[v]].begin(), u[d[v]].end(), v, comp) - u[d[v]].begin();
  int left = lower_bound(u[h].begin(), u[h].end(), v, comp) - u[h].begin();
  int right;
  if (pos == u[d[v]].size() - 1)
    right = u[h].size() - 1;
  else
    right = upper_bound(u[h].begin(), u[h].end(), u[d[v]][pos + 1], comp) -
            u[h].begin() - 1;
  if (right >= (int)(u[h].size())) right = (int)u[h].size() - 1;
  if (left >= right) return true;
  int cnt = 0;
  for (int i = 0; i < 26; i++) {
    if ((left == 0 && parity[i][u[h][right]]) ||
        (left > 0 && parity[i][u[h][left - 1]] ^ parity[i][u[h][right]]))
      cnt++;
  }
  return cnt <= 1;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i < n; i++) {
    scanf("%d", &p[i]);
    p[i]--;
    v[p[i]].push_back(i);
  }
  scanf("%s", letters);
  init();
  int v, h;
  while (m--) {
    scanf("%d %d", &v, &h);
    printf(query(v - 1, h) ? "Yes\n" : "No\n");
  }
  return 0;
}
