#include <bits/stdc++.h>
int dr[] = {2, 2, -2, -2, 1, -1, 1, -1};
int dc[] = {1, -1, 1, -1, 2, 2, -2, -2};
int dr1[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dc1[] = {1, -1, 1, 0, -1, 0, 1, -1};
int dr2[] = {0, 0, 1, -1};
int dc2[] = {1, -1, 0, 0};
using namespace std;
long long int sub[1000005], dis[1000005], ans[1000005], b[1000005],
    mark[1000005];
vector<long long int> adj[1000005];
vector<pair<long long int, long long int> > adj1[1000005];
void dfs(long long int u) {
  long long int i, j;
  sub[u] = 1;
  for (i = 0; i < adj[u].size(); i++) {
    long long int p = adj[u][i];
    dis[p] = dis[u] + 1;
    dfs(p);
    sub[u] += sub[p];
  }
}
string t;
void add(long long int u) {
  long long int i, j;
  long long int x = t[u - 1] - 'a';
  b[dis[u]] ^= (1 << x);
  for (i = 0; i < adj[u].size(); i++) {
    long long int p = adj[u][i];
    if (mark[p] == 1) continue;
    add(p);
  }
}
void dsu(long long int u, long long int f) {
  long long int mx = 0, big = 0, i;
  for (i = 0; i < adj[u].size(); i++) {
    long long int p = adj[u][i];
    if (sub[p] > mx) {
      mx = sub[p];
      big = p;
    }
  }
  for (i = 0; i < adj[u].size(); i++) {
    long long int p = adj[u][i];
    if (p == big) continue;
    dsu(p, 0);
  }
  if (big != 0) {
    dsu(big, 1);
  }
  mark[big] = 1;
  add(u);
  for (i = 0; i < adj1[u].size(); i++) {
    long long int p = adj1[u][i].first;
    long long int x = adj1[u][i].second;
    long long int r = __builtin_popcount(b[p]);
    if (r <= 1) ans[x] = 1;
  }
  mark[big] = 0;
  if (f == 0) add(u);
}
int main() {
  long long int n, q, i, j, x, y;
  scanf("%lld%lld", &n, &q);
  for (i = 2; i <= n; i++) {
    scanf("%lld", &x);
    adj[x].push_back(i);
  }
  cin >> t;
  for (i = 1; i <= q; i++) {
    scanf("%lld%lld", &x, &y);
    adj1[x].push_back(make_pair(dis[x] + y - 1, i));
  }
  dfs(1);
  dsu(1, 0);
  for (i = 1; i <= q; i++) {
    if (ans[i])
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
