#include <bits/stdc++.h>
using namespace std;
const int mxn = 5e5 + 10;
vector<int> adj[mxn];
vector<pair<int, int>> query[mxn];
int sbtr[mxn], ord[mxn], depth[mxn], euler[mxn], ans[mxn], freq[mxn][26], t = 0;
char ch[mxn];
void dfs(int src, int par, int lev) {
  sbtr[src] = 1;
  ord[src] = t;
  euler[t] = src;
  depth[src] = lev;
  t++;
  for (int i = 0; i < adj[src].size(); i++)
    if (adj[src][i] != par) {
      dfs(adj[src][i], src, lev + 1);
      sbtr[src] += sbtr[adj[src][i]];
    }
}
void dsu(int src, int par, bool keep) {
  int mx = -1, idx = -1;
  for (int i = 0; i < adj[src].size(); i++)
    if (adj[src][i] != par && sbtr[adj[src][i]] > mx) {
      mx = sbtr[adj[src][i]];
      idx = i;
    }
  for (int i = 0; i < adj[src].size(); i++)
    if (i != idx && adj[src][i] != par) dsu(adj[src][i], src, false);
  if (idx != -1) dsu(adj[src][idx], src, true);
  for (int i = 0; i < adj[src].size(); i++)
    if (i != idx && adj[src][i] != par) {
      int x = adj[src][i];
      for (int j = ord[x]; j < ord[x] + sbtr[x]; j++) {
        int u = euler[j];
        freq[depth[u]][ch[u] - 'a']++;
      }
    }
  freq[depth[src]][ch[src] - 'a']++;
  for (int i = 0; i < query[src].size(); i++) {
    int d = query[src][i].first, odd = 0;
    for (int j = 0; j < 26; j++) odd += (freq[d][j] % 2 != 0 ? 1 : 0);
    if (odd <= 1) ans[query[src][i].second] = 1;
  }
  if (!keep) {
    for (int i = ord[src]; i < ord[src] + sbtr[src]; i++) {
      int u = euler[i];
      freq[depth[u]][ch[u] - 'a']--;
    }
  }
}
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  for (int i = 2; i <= n; i++) {
    int u;
    scanf("%d", &u);
    adj[i].push_back(u);
    adj[u].push_back(i);
  }
  string str;
  cin >> str;
  int l = str.size();
  for (int i = 0; i < l; i++) ch[i + 1] = str[i];
  for (int i = 0; i < q; i++) {
    int u, h;
    scanf("%d%d", &u, &h);
    query[u].push_back({h, i});
  }
  dfs(1, 0, 1);
  dsu(1, 0, 0);
  for (int i = 0; i < q; i++) {
    if (ans[i] == 1)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
