#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int maxn = 500005;
int n, m, cnt = 0, in[maxn], out[maxn], depth[maxn];
vector<int> G[maxn], inn[maxn], dian[maxn], D[maxn];
int MAXd = 0;
string a;
void dfs(int u, int d) {
  in[u] = ++cnt;
  depth[u] = d;
  inn[depth[u]].push_back(in[u]);
  dian[depth[u]].push_back(u);
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    dfs(v, d + 1);
  }
  out[u] = cnt;
  MAXd = max(MAXd, d);
}
int lowbit(int x) { return x & (-x); }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 2; i <= n; i++) {
    int u;
    scanf("%d", &u);
    G[u].push_back(i);
  }
  dfs(1, 1);
  char a[maxn];
  scanf("%s", a + 1);
  for (int i = 1; i <= MAXd; i++) {
    for (int j = 0, y = 0; j < dian[i].size(); j++) {
      int x = a[dian[i][j]] - 'a';
      x = 1 << x;
      y = y ^ x;
      D[i].push_back(y);
    }
  }
  while (m--) {
    int v, h;
    scanf("%d%d", &v, &h);
    int L = lower_bound(inn[h].begin(), inn[h].end(), in[v]) - inn[h].begin();
    int R =
        upper_bound(inn[h].begin(), inn[h].end(), out[v]) - inn[h].begin() - 1;
    if (R < 0) {
      puts("Yes");
      continue;
    }
    int ans;
    if (L == 0)
      ans = D[h][R];
    else
      ans = D[h][R] ^ D[h][L - 1];
    ans = ans - lowbit(ans);
    if (!ans)
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
