#include <bits/stdc++.h>
using namespace std;
char s[500000 + 5];
int in[500000 + 5], out[500000 + 5], cnt;
vector<int> e[500000 + 5];
vector<pair<int, int> > vec[500000 + 5];
void dfs(int now, int dep) {
  in[now] = ++cnt;
  vec[dep].push_back({cnt, vec[dep].back().second ^ (1 << (s[now] - 'a'))});
  for (auto v : e[now]) dfs(v, dep + 1);
  out[now] = cnt;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 2; i <= n; i++) {
    int x;
    scanf("%d", &x);
    e[x].push_back(i);
  }
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++) vec[i].push_back({0, 0});
  dfs(1, 1);
  for (int i = 1; i <= m; i++) {
    int v, h;
    scanf("%d%d", &v, &h);
    int l = lower_bound(vec[h].begin(), vec[h].end(), make_pair(in[v], -1)) -
            vec[h].begin() - 1;
    int r = upper_bound(vec[h].begin(), vec[h].end(),
                        make_pair(out[v], 0x3f3f3f3f)) -
            vec[h].begin() - 1;
    int x = vec[h][l].second ^ vec[h][r].second;
    if (x - (x & -x))
      puts("No");
    else
      puts("Yes");
  }
  return 0;
}
