#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
vector<int> G[N], Q[N];
int h[N];
int res[N], pre[N];
char str[N];
int n, m;
void init() {
  memset(res, 0, sizeof(res));
  for (int i = 1; i <= n; i++) {
    G[i].clear(), Q[i].clear();
  }
}
void dfs(int u, int de) {
  for (int i = 0; i < Q[u].size(); i++) {
    int id = Q[u][i];
    res[id] ^= pre[h[id]];
  }
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    dfs(v, de + 1);
  }
  pre[de] ^= (1 << (str[u] - 'a'));
  for (int i = 0; i < Q[u].size(); i++) {
    int id = Q[u][i];
    res[id] ^= pre[h[id]];
  }
}
bool judge(int num) {
  if (num == 0) return true;
  int cnt = 0;
  while (num) {
    if (num & 1) cnt++;
    num >>= 1;
  }
  return cnt == 1;
}
int main() {
  while (scanf("%d%d", &n, &m) != EOF) {
    init();
    int fa;
    for (int i = 2; i <= n; i++) {
      scanf("%d", &fa);
      G[fa].push_back(i);
    }
    scanf("%s", str + 1);
    int V, H;
    for (int i = 1; i <= m; i++) {
      scanf("%d%d", &V, &H);
      Q[V].push_back(i);
      h[i] = H;
    }
    dfs(1, 1);
    for (int i = 1; i <= m; i++) {
      puts(judge(res[i]) ? "Yes" : "No");
    }
  }
  return 0;
}
