#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const int N = 500100;
int n, ANS[N], q, dep[N];
char s[N];
vector<int> adj[N];
vector<pair<int, int> > Q[N];
int cnt[N], sz[N];
bool big[N];
void dfs1(int u, int par) {
  dep[u] = 1 + dep[par];
  sz[u] = 1;
  for (auto v : adj[u]) {
    if (v != par) {
      dfs1(v, u);
      sz[u] += sz[v];
    }
  }
  return;
}
void add(int u, int p, int x) {
  cnt[dep[u]] ^= (1 << (s[u] - 'a'));
  for (auto v : adj[u])
    if (v != p && !big[v]) add(v, u, x);
}
void dfs(int u, int p, bool keep) {
  int mx = -1, bigChild = -1;
  for (auto v : adj[u])
    if (v != p && sz[v] > mx) mx = sz[v], bigChild = v;
  for (auto v : adj[u])
    if (v != p && v != bigChild) dfs(v, u, 0);
  if (bigChild != -1) dfs(bigChild, u, 1), big[bigChild] = 1;
  add(u, p, 1);
  for (auto x : Q[u]) {
    ANS[x.first] = cnt[x.second];
  }
  if (bigChild != -1) big[bigChild] = 0;
  if (keep == 0) add(u, p, -1);
}
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 2; i <= n; i++) {
    int x;
    scanf("%d", &x);
    adj[x].push_back(i);
    adj[i].push_back(x);
  }
  scanf("%s", s + 1);
  for (int i = 1; i <= q; i++) {
    int v, d;
    scanf("%d %d", &v, &d);
    Q[v].push_back({i, d});
  }
  dfs1(1, 0);
  dfs(1, 0, 0);
  for (int i = 1; i <= q; i++) {
    if (ANS[i] == -1 || __builtin_popcount(ANS[i]) <= 1)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
