#include <bits/stdc++.h>
using namespace std;
template <typename T>
T nextInt() {
  T x = 0, p = 1;
  char ch;
  do {
    ch = getchar();
  } while (ch <= ' ');
  if (ch == '-') {
    p = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return x * p;
}
const int maxN = 1e6 + 10;
const int maxAlpha = 26;
const int INF = (int)1e9;
const int mod = (int)1e9 + 7;
const long long LLINF = (long long)1e18;
int n, q;
vector<int> g[maxN];
int l[maxN];
int r[maxN];
int height[maxN];
int code[maxN];
vector<pair<int, int> > t;
vector<char> prefSum[maxAlpha];
char s[maxN];
int dfs(int v, int h) {
  static int timer = 0;
  l[v] = timer++;
  height[v] = h;
  code[l[v]] = s[v] - 'a';
  t.push_back(make_pair(height[v], l[v]));
  int ret = 1;
  for (int x : g[v]) {
    ret += dfs(x, h + 1);
  }
  r[v] = timer++;
  code[r[v]] = -1;
  t.push_back(make_pair(height[v], r[v]));
  return ret;
}
int calc(int chr, int l, int r) {
  if (l > r) return 0;
  if (l == 0) return prefSum[chr][r];
  return prefSum[chr][r] ^ prefSum[chr][l - 1];
}
bool solve(int v, int h) {
  int le = lower_bound(t.begin(), t.end(), make_pair(h, l[v])) - t.begin();
  int ri = --upper_bound(t.begin(), t.end(), make_pair(h, r[v])) - t.begin();
  int odd = 0;
  for (int i = 0; i < 26; ++i) {
    int freq = calc(i, le, ri);
    odd += freq;
  }
  return odd <= 1;
}
void precalc() {
  sort(t.begin(), t.end());
  for (int i = 0; i < maxAlpha; ++i) {
    prefSum[i].resize(2 * n);
  }
  for (int i = 0; i < 2 * n; ++i) {
    int code = ::code[t[i].second];
    for (int j = 0; j < maxAlpha; ++j) {
      prefSum[j][i] = (code == j ? 1 : 0);
      if (i >= 1) {
        prefSum[j][i] ^= prefSum[j][i - 1];
      }
    }
  }
}
int main() {
  n = nextInt<int>();
  q = nextInt<int>();
  for (int i = 1; i < n; ++i) {
    int x = nextInt<int>() - 1;
    g[x].push_back(i);
  }
  gets(s);
  dfs(0, 1);
  precalc();
  while (q--) {
    int v = nextInt<int>() - 1;
    int h = nextInt<int>();
    puts(solve(v, h) ? "Yes" : "No");
  }
  return 0;
}
