#include <bits/stdc++.h>
using namespace std;
long long gcd(long long n1, long long n2) {
  if (!n1) return n2;
  if (!n2) return n1;
  if (n1 % n2 == 0) return n2;
  return gcd(n2, n1 % n2);
}
long long powmod(long long base, long long exponent) {
  base %= 1000000007;
  long long ans = 1;
  while (exponent) {
    if (exponent & 1) ans = (ans * base) % 1000000007;
    base = (base * base) % 1000000007;
    exponent /= 2;
  }
  ans %= 1000000007;
  return ans;
}
vector<int> adj[1000100 + 1];
int in[1000100 + 1];
int out[1000100 + 1];
int arr[1000100 + 1];
vector<pair<int, int> > pre[1000100 + 1];
int timer = 0;
void dfs(int node, int lv) {
  in[node] = (++timer);
  pre[lv].push_back(make_pair(timer, arr[node]));
  for (int i = 0; i < adj[node].size(); i++) dfs(adj[node][i], lv + 1);
  out[node] = (timer);
}
int solve(int i, int j, int h) {
  int ret = 0, l, r, mid;
  l = 0;
  r = pre[h].size() - 1;
  while (r - l > 1) {
    mid = (l + r) >> 1;
    if (pre[h][mid].first > i)
      r = mid;
    else
      l = mid;
  }
  while (pre[h][r].first > i) r--;
  ret ^= pre[h][r].second;
  l = 0;
  r = pre[h].size() - 1;
  while (r - l > 1) {
    mid = (l + r) >> 1;
    if (pre[h][mid].first > j)
      r = mid;
    else
      l = mid;
  }
  while (pre[h][r].first > j) r--;
  ret ^= pre[h][r].second;
  return ret;
}
int main() {
  int i, j, k, n, q, v, h;
  scanf("%d", &n);
  scanf("%d", &q);
  for (i = 2; i <= n; i++) {
    scanf("%d", &j);
    adj[j].push_back(i);
  }
  for (i = 1; i <= n; i++) {
    char c;
    scanf(" %c", &c);
    int temp = (c - 'a');
    arr[i] = (1 << temp);
  }
  for (i = 1; i <= n + 1; i++) {
    pre[i].push_back(make_pair(0, 0));
  }
  dfs(1, 1);
  for (i = 1; i <= n + 1; i++) {
    for (j = 1; j < pre[i].size(); j++)
      pre[i][j].second ^= pre[i][j - 1].second;
  }
  while (q--) {
    scanf("%d", &v);
    scanf("%d", &h);
    int res = (solve(in[v] - 1, out[v], h));
    if (res & (res - 1))
      printf("No\n");
    else
      printf("Yes\n");
  }
  return 0;
}
