#include <bits/stdc++.h>
using namespace std;
const int MAX = 500005;
int n, m, cnt = 1;
vector<int> G[MAX], dep[MAX], pre[MAX];
char s[MAX];
int dfs[MAX][2], f[MAX];
void DFS(int u, int d) {
  dfs[u][0] = cnt++;
  dep[d].push_back(u);
  f[u] = d;
  pre[d].push_back(1 << (s[u] - 'a'));
  for (int i = 0; i < G[u].size(); ++i) {
    int v = G[u][i];
    DFS(v, d + 1);
  }
  dfs[u][1] = cnt++;
}
int lower(int u, int d) {
  if (!dep[d].size()) return -1;
  int l = 0, r = dep[d].size() - 1;
  while (r - l > 1) {
    int mid = (l + r) / 2, v = dep[d][mid];
    if (dfs[v][0] < dfs[u][0])
      l = mid;
    else
      r = mid;
  }
  if (dfs[u][0] <= dfs[dep[d][l]][0] && dfs[dep[d][l]][0] <= dfs[u][1])
    return l;
  if (dfs[u][0] <= dfs[dep[d][r]][0] && dfs[dep[d][r]][0] <= dfs[u][1])
    return r;
  return -1;
}
int upper(int u, int d) {
  if (!dep[d].size()) return -1;
  int l = 0, r = dep[d].size() - 1;
  while (r - l > 1) {
    int mid = (l + r) / 2, v = dep[d][mid];
    if (dfs[v][0] <= dfs[u][1])
      l = mid;
    else
      r = mid;
  }
  if (dfs[u][0] <= dfs[dep[d][r]][0] && dfs[dep[d][r]][0] <= dfs[u][1])
    return r;
  if (dfs[u][0] <= dfs[dep[d][l]][0] && dfs[dep[d][l]][0] <= dfs[u][1])
    return l;
  return -1;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 2; i <= n; ++i) {
    int p;
    scanf("%d", &p);
    G[p].push_back(i);
  }
  scanf("%s", s + 1);
  DFS(1, 1);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j < pre[i].size(); ++j) pre[i][j] ^= pre[i][j - 1];
  }
  while (m--) {
    int u, d;
    scanf("%d%d", &u, &d);
    if (f[u] >= d)
      puts("Yes");
    else {
      int t1 = lower(u, d), t2 = upper(u, d);
      if (t1 == -1)
        puts("Yes");
      else {
        int tmp;
        if (t1)
          tmp = pre[d][t2] ^ pre[d][t1 - 1];
        else
          tmp = pre[d][t2];
        int t = 0;
        for (int i = 0; i < 26; ++i) {
          if (1 << i & tmp) ++t;
        }
        if (t < 2)
          puts("Yes");
        else
          puts("No");
      }
    }
  }
  return 0;
}
