#include <bits/stdc++.h>
using namespace std;
int T = 0;
void dfs(int v, vector<vector<int> > &g, vector<int> &tin, vector<int> &tout) {
  tin[v] = ++T;
  for (auto to : g[v]) {
    dfs(to, g, tin, tout);
  }
  tout[v] = ++T;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  vector<int> p(n);
  vector<vector<int> > g(n);
  for (int i = 1; i < n; ++i) {
    scanf("%d", &p[i]);
    --p[i];
    g[p[i]].push_back(i);
  }
  static char s[500000];
  scanf("%s", s);
  vector<int> h(n);
  h[0] = 0;
  int maxh = 0;
  for (int i = 1; i < n; ++i) {
    h[i] = h[p[i]] + 1;
    maxh = max(maxh, h[i]);
  }
  vector<vector<pair<int, int> > > slices(maxh + 1,
                                          vector<pair<int, int> >(1, {0, 0}));
  vector<int> tin(n), tout(n);
  dfs(0, g, tin, tout);
  for (int i = 0; i < n; ++i) {
    slices[h[i]].push_back({tin[i], i});
  }
  for (int i = 0; i <= maxh; ++i) {
    sort(slices[i].begin(), slices[i].end());
  }
  vector<vector<vector<int> > > sum(maxh + 1);
  for (int i = 0; i <= maxh; ++i) {
    sum[i].resize(slices[i].size(), vector<int>(26, 0));
    for (int j = 1; j < sum[i].size(); ++j) {
      for (int k = 0; k < 26; ++k) {
        sum[i][j][k] = sum[i][j - 1][k] + (s[slices[i][j].second] == k + 'a');
      }
    }
  }
  for (int i = 0; i < m; ++i) {
    int V, H;
    scanf("%d%d", &V, &H);
    --V, --H;
    if (h[V] > H || H > maxh) {
      printf("Yes\n");
      continue;
    }
    int l = 0, r = slices[H].size() - 1;
    while (l < r) {
      int m = (l + r) / 2 + 1;
      if (tin[slices[H][m].second] < tin[V]) {
        l = m;
      } else {
        r = m - 1;
      }
    }
    int L = l;
    l = 0, r = slices[H].size() - 1;
    while (l < r) {
      int m = (l + r) / 2 + 1;
      if (tout[slices[H][m].second] < tout[V]) {
        l = m;
      } else {
        r = m - 1;
      }
    }
    int R = l;
    int c = 0;
    for (int j = 0; j < 26; ++j) {
      if ((sum[H][R][j] - sum[H][L][j]) % 2) {
        c++;
      }
    }
    if (c >= 2) {
      printf("No\n");
    } else {
      printf("Yes\n");
    }
  }
}
