#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
int n, m, used[N], tin[N], w[N], tout[N], timer = 1;
vector<int> g[N], H[N], pref[N];
void DFS(int v, int h) {
  used[v] = 1;
  tin[v] = timer;
  H[h].push_back(v);
  timer++;
  for (auto to : g[v]) {
    if (used[to] == 0) {
      DFS(to, h + 1);
    }
  }
  tout[v] = timer;
  timer++;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int k = 2; k <= n; k++) {
    int first;
    scanf("%d", &first);
    g[first].push_back(k);
    g[k].push_back(first);
  }
  DFS(1, 1);
  string s;
  cin >> s;
  for (int k = 0; k < n; k++) {
    int val = (s[k] - 'a');
    w[k + 1] = 1 << val;
  }
  for (int k = 1; k <= n; k++) {
    pref[k].resize(H[k].size());
    for (int i = 0; i < H[k].size(); i++) {
      int v = H[k][i];
      pref[k][i] = w[v];
      if (i != 0) pref[k][i] = pref[k][i] ^ pref[k][i - 1];
    }
  }
  for (int k = 1; k <= m; k++) {
    int a, h;
    scanf("%d%d", &a, &h);
    if (H[h].size() == 0) {
      printf("Yes\n");
      continue;
    }
    int L = 0, R = 0;
    int l = 0, r = H[h].size() - 1;
    if (tin[H[h][r]] < tin[a] && tout[H[h][0]] > tout[a]) {
      printf("Yes\n");
      continue;
    }
    while (r - l > 1) {
      int mid = (l + r) / 2;
      if (tin[a] <= tin[H[h][mid]])
        r = mid;
      else
        l = mid;
    }
    L = r;
    if (tin[H[h][l]] >= tin[a]) L = l;
    l = 0;
    r = H[h].size() - 1;
    while (r - l > 1) {
      int mid = (l + r) / 2;
      if (tout[a] >= tout[H[h][mid]])
        l = mid;
      else
        r = mid;
    }
    R = l;
    if (tout[H[h][r]] <= tout[a]) R = r;
    int p = pref[h][R];
    if (L != 0) p = p ^ pref[h][L - 1];
    if ((R - L + 1) % 2 == 0) {
      if (p == 0)
        printf("Yes\n");
      else
        printf("No\n");
    } else {
      if (__builtin_popcount(p) == 1)
        printf("Yes\n");
      else
        printf("No\n");
    }
  }
  return 0;
}
