#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
vector<int> edge[maxn];
char s[maxn];
int in[maxn], out[maxn], tot;
vector<pair<int, int> > H[maxn];
int A[30];
void dfs(int u, int h) {
  in[u] = ++tot;
  H[h].push_back({tot, H[h].back().second ^ (A[s[u] - 'a'])});
  for (auto v : edge[u]) dfs(v, h + 1);
  out[u] = ++tot;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) H[i].resize(1);
  for (int i = 2, x; i <= n; i++) {
    scanf("%d", &x);
    edge[x].push_back(i);
  }
  for (int i = 0; i < 27; i++) A[i] = (1 << i);
  scanf("%s", s + 1);
  dfs(1, 1);
  while (m--) {
    int v, h;
    scanf("%d%d", &v, &h);
    int x = lower_bound(H[h].begin(), H[h].end(), make_pair(in[v], -1)) -
            H[h].begin() - 1;
    int y = lower_bound(H[h].begin(), H[h].end(), make_pair(out[v], -1)) -
            H[h].begin() - 1;
    int t = H[h][x].second ^ H[h][y].second;
    bool ok = t - (t & -t);
    printf("%s\n", ok ? "No" : "Yes");
  }
  return 0;
}
