#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 7;
vector<int> graph[N], pre[N];
vector<pair<int, int> > query[N];
int n, ans[N], freq[N][27], level[N];
string s;
void dfs(int node, int dep) {
  for (auto i : query[node]) {
    int depth = i.first;
    for (int j = 1; j <= 26; j++) {
      pre[node].push_back(freq[depth][j]);
    }
  }
  freq[dep][s[node] - 'a' + 1]++;
  level[node] = dep;
  for (int u : graph[node]) {
    dfs(u, dep + 1);
  }
  int it = 0;
  for (auto i : query[node]) {
    int depth = i.first;
    int pos = i.second;
    int parity = 0;
    for (int j = 1; j <= 26; j++) {
      parity += (freq[depth][j] - pre[node][it]) % 2;
      it++;
    }
    if (parity <= 1) {
      ans[pos] = 1;
    } else {
      ans[pos] = 0;
    }
  }
}
int main() {
  int q;
  scanf("%d %d", &n, &q);
  for (int i = 2; i <= n; i++) {
    int x;
    scanf("%d", &x);
    graph[x].push_back(i);
  }
  int node, height;
  cin >> s;
  s = '0' + s;
  for (int i = 1; i <= q; i++) {
    scanf("%d %d", &node, &height);
    query[node].push_back({height, i});
  }
  dfs(1, 1);
  for (int i = 1; i <= q; i++) {
    if (ans[i])
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
