#include <bits/stdc++.h>
using namespace std;
const int N = (int)5e5 + 7;
const int P = 26;
vector<vector<int>> g(N);
vector<vector<pair<int, int>>> in(N);
int timer = 0, tin[N], tout[N];
char s[N];
vector<int> sum[N];
void dfs(int v = 0, int h = 0, int p = -1) {
  tin[v] = timer++;
  in[h].push_back(make_pair(tin[v], v));
  for (auto to : g[v]) {
    if (to == p) continue;
    dfs(to, h + 1, v);
  }
  tout[v] = timer++;
}
int get(int h, int l, int r) {
  if (l > r) return 0;
  if (l == 0)
    return sum[h][r];
  else
    return sum[h][r] ^ sum[h][l - 1];
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 2; i <= n; ++i) {
    int pi;
    scanf("%d", &pi);
    pi--;
    g[i - 1].push_back(pi), g[pi].push_back(i - 1);
  }
  dfs();
  scanf("%s", &s);
  for (int h = 0; h < N; h++) {
    sum[h].resize(in[h].size());
    if (in[h].empty()) continue;
    int bit = int(s[in[h][0].second] - 'a');
    sum[h][0] = (1 << bit);
    for (int i = 1; i < (int)in[h].size(); i++) {
      bit = int(s[in[h][i].second] - 'a');
      sum[h][i] = sum[h][i - 1] ^ (1 << bit);
    }
  }
  for (int i = 0; i < m; ++i) {
    int x, h;
    scanf("%d%d", &x, &h);
    x--, h--;
    int fin = tin[x], fout = tout[x];
    int l = lower_bound(in[h].begin(), in[h].end(), make_pair(fin, 0)) -
            in[h].begin();
    int r = upper_bound(in[h].begin(), in[h].end(), make_pair(fout, INT_MAX)) -
            in[h].begin() - 1;
    int res = __builtin_popcount(get(h, l, r));
    if (res > 1)
      printf("No\n");
    else
      printf("Yes\n");
  }
  return 0;
}
