#include <bits/stdc++.h>
using namespace std;
int solve(int i, vector<int>* graph, int current_time, int level,
          pair<int, int>* exp_time, vector<vector<pair<int, int>>>& levels,
          int* vals, int* arr) {
  if (levels.size() <= level) levels.push_back(vector<pair<int, int>>());
  levels.at(level).push_back(
      make_pair(current_time, arr[level] = vals[i] ^ arr[level]));
  int max_time = current_time;
  for (int& j : graph[i]) {
    max_time = max(current_time, solve(j, graph, max_time + 1, level + 1,
                                       exp_time, levels, vals, arr));
  }
  exp_time[i] = make_pair(current_time, max_time);
  return max_time;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<int>* graph = new vector<int>[n];
  int* vals = new int[n];
  vector<vector<pair<int, int>>>* levels = new vector<vector<pair<int, int>>>();
  pair<int, int>* exp_time = new pair<int, int>[n];
  for (int i = 1; i < n; i++) {
    int a;
    scanf("%d", &a);
    graph[a - 1].push_back(i);
  }
  getchar();
  for (int i = 0; i < n; i++) {
    char a;
    scanf("%c", &a);
    vals[i] = 1 << (int)(a - 'a');
  }
  solve(0, graph, 0, 0, exp_time, *levels, vals, new int[n]());
  for (int i = 0; i < m; i++) {
    int v, h;
    scanf("%d%d", &v, &h);
    v = v - 1;
    h = h - 1;
    if (levels->size() <= h) {
      printf("Yes\n");
      continue;
    }
    int lb = exp_time[v].first;
    int ub = exp_time[v].second + 1;
    const vector<pair<int, int>>& level = levels->at(h);
    int lo = 0, hi = level.size() - 1;
    while (lo < hi) {
      int mid = (lo + hi) / 2;
      if (level[mid].first < lb)
        lo = mid + 1;
      else
        hi = mid;
    }
    int left = lo;
    lo = left;
    hi = level.size() - 1;
    while (lo < hi) {
      int mid = (lo + hi + 1) / 2;
      if (level[mid].first < ub)
        lo = mid;
      else
        hi = mid - 1;
    }
    int right = lo;
    int letter =
        level.at(right).second ^ (left > 0 ? level.at(left - 1).second : 0);
    if (level[left].first >= lb && letter & -letter ^ letter)
      printf("No\n");
    else
      printf("Yes\n");
  }
  return 0;
}
