#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 10;
int n, m, timer = 0, in[MAXN], out[MAXN];
vector<int> h[MAXN], g[MAXN], at[MAXN], tit[MAXN];
char str[MAXN];
void dfs(int u, int dep) {
  in[u] = ++timer;
  h[dep].emplace_back(in[u]);
  at[dep].emplace_back(str[u] - 'a');
  for (int x : g[u]) dfs(x, dep + 1);
  out[u] = ++timer;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i < n; ++i) {
    int p;
    scanf("%d", &p);
    --p;
    g[p].emplace_back(i);
  }
  scanf("%s", str);
  dfs(0, 0);
  for (int i = 0; i < n; ++i) {
    int now = 0;
    for (int j = 0; j < h[i].size(); ++j) {
      now ^= (1 << at[i][j]);
      tit[i].push_back(now);
    }
  }
  for (int i = 0; i < m; ++i) {
    int v, ht;
    scanf("%d %d", &v, &ht);
    --v;
    --ht;
    if (h[ht].size() <= 1) {
      printf("Yes\n");
      continue;
    }
    int ff = lower_bound(h[ht].begin(), h[ht].end(), in[v]) - h[ht].begin();
    int tt =
        lower_bound(h[ht].begin(), h[ht].end(), out[v]) - h[ht].begin() - 1;
    if (ff == -1 || ff >= h[ht].size() || tt == -1) {
      printf("Yes\n");
      continue;
    }
    int xx = tit[ht][tt] ^ (ff - 1 >= 0 ? tit[ht][ff - 1] : 0);
    if (__builtin_popcount(xx) < 2)
      printf("Yes\n");
    else
      printf("No\n");
  }
}
