#include <bits/stdc++.h>
using namespace std;
unordered_map<int, int> poz;
struct node {
  int idx;
  char ch;
  int parent;
  vector<int> adj;
  int level;
  int dfs_enter;
  int dfs_exit;
  int cnt[26];
  int mk[26];
  void print() {
    printf("{{{Node %d:\n", idx);
    printf("char:%c parent:%d level:%d\n", ch, parent, level);
    printf("DFSN: [%d, %d]\n kids: %d\n", dfs_enter, dfs_exit, adj.size());
    printf("Cnt:\n");
    for (int i = 0; i <= 25; i++) printf("%d", cnt[i]);
    printf("\nMk:\n");
    for (int i = 0; i <= 25; i++) printf("%d", mk[i]);
    printf("\nEndnode}}}\n");
  }
  node() {
    for (int i = 0; i <= 25; i++) cnt[i] = mk[i] = 0;
  }
  node(int E, int H) {
    dfs_enter = E;
    level = H;
  }
  const bool operator<(const node& a) const {
    if (this->level == a.level) {
      return this->dfs_enter < a.dfs_enter;
    }
    return this->level < a.level;
  }
};
node a[500005];
int n, m;
char s[500005];
int T;
void DFS(int curr, int l) {
  a[curr].level = l;
  a[curr].dfs_enter = T++;
  int sz = a[curr].adj.size();
  for (int i = 0; i <= sz - 1; i++) {
    int nxt = a[curr].adj[i];
    DFS(nxt, l + 1);
  }
  a[curr].dfs_exit = T++;
}
int left(int v, int h) {
  node q(a[poz[v]].dfs_enter, h);
  node* it = lower_bound(a + 1, a + n + 1, q);
  return it - a;
}
int right(int v, int h) {
  node q(a[poz[v]].dfs_exit, h);
  node* it = upper_bound(a + 1, a + n + 1, q);
  --it;
  return it - a;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 2; i <= n; i++) {
    int v;
    scanf("%d", &v);
    a[i].parent = v;
    a[v].adj.push_back(i);
  }
  scanf("%s", s);
  for (int i = 0; i <= n - 1; i++) {
    a[i + 1].idx = i + 1;
    a[i + 1].ch = s[i];
  }
  T = 0;
  DFS(1, 1);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    poz[a[i].idx] = i;
    int idx = a[i].ch - 'a';
    a[i].cnt[idx] = 1;
    for (int j = 0; j <= 25; j++) {
      a[i].mk[j] = a[i - 1].mk[j] + a[i].cnt[j];
    }
  }
  for (int i = 1; i <= m; i++) {
    int v, h;
    scanf("%d %d", &v, &h);
    int L = left(v, h);
    int R = right(v, h);
    if (L > R) {
      printf("Yes\n");
      continue;
    }
    int np = 0;
    for (int j = 0; j <= 25; j++) {
      int num = a[R].mk[j] - a[L - 1].mk[j];
      if (num % 2 != 0) {
        np++;
      }
    }
    if (np <= 1) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}
