#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 7;
const int mod = 1e9 + 7;
const int INF = 1e9 + 7;
const int mlog = 20;
const int SQ = 400;
vector<int> adj[maxn], H[maxn];
int h[maxn], st[maxn], en[maxn];
int cnt[maxn][27];
char s[maxn];
int timer = 0;
void dfs(int v, int par = -1) {
  st[v] = timer++;
  H[h[v]].push_back(v);
  for (int u : adj[v])
    if (u != par) h[u] = h[v] + 1, dfs(u, v);
  en[v] = timer;
}
int n, q;
void PREP() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < H[i].size(); j++) {
      int v = H[i][j];
      for (int k = 0; k < 26; k++) {
        int last = (j == 0 ? 0 : cnt[H[i][j - 1]][k]);
        if (k != (s[v] - 'a'))
          cnt[v][k] = (last + 0) % 2;
        else
          cnt[v][k] = (last + 1) % 2;
      }
    }
  }
}
int low_bound(int he, int v) {
  int lo = -1, hi = H[he].size() - 1;
  while (hi - lo > 1) {
    int mid = (hi + lo) / 2;
    if (st[H[he][mid]] >= st[v])
      hi = mid;
    else
      lo = mid;
  }
  return hi;
}
int upp_bound(int he, int v) {
  int lo = 0, hi = H[he].size();
  while (hi - lo > 1) {
    int mid = (hi + lo) / 2;
    if (en[H[he][mid]] <= en[v])
      lo = mid;
    else
      hi = mid;
  }
  return lo;
}
int32_t main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i < n; i++) {
    int p;
    scanf("%d", &p);
    p--;
    adj[i].push_back(p), adj[p].push_back(i);
  }
  scanf("%s", s);
  dfs(0);
  PREP();
  while (q--) {
    int v, he;
    scanf("%d%d", &v, &he);
    v--, he--;
    if (he < h[v] || H[he].size() == 0) {
      printf("Yes\n");
      continue;
    }
    int l = low_bound(he, v);
    int r = upp_bound(he, v);
    int res = 0;
    for (int k = 0; k < 26; k++)
      if (cnt[H[he][r]][k] != (l == 0 ? 0 : cnt[H[he][l - 1]][k])) res++;
    if (res < 2)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
