#include <bits/stdc++.h>
using namespace std;
const int N = 500001;
int n, m, t, d, dpth[N], s[N], e[N];
char c[N + 1];
vector<vector<int> > g;
vector<vector<pair<int, vector<int> > > > v;
void dfs(int u, int p) {
  s[u] = t++;
  d = max(d, dpth[u]);
  for (int i = 0; i < g[u].size(); i++)
    if (g[u][i] != p) {
      dpth[g[u][i]] = dpth[u] + 1;
      dfs(g[u][i], u);
    }
  e[u] = t++;
}
void dfs2(int u, int p) {
  vector<int> t;
  t.resize(26);
  int x = v[dpth[u]].size();
  t[c[u] - 'a']++;
  if (x > 0) {
    for (int j = 0; j < 26; j++) t[j] += v[dpth[u]][x - 1].second[j];
  }
  v[dpth[u]].push_back(make_pair(u, t));
  for (int i = 0; i < g[u].size(); i++)
    if (g[u][i] != p) dfs2(g[u][i], u);
}
bool check(int l, int i, int j) {
  int o = 0;
  for (int k = 0; k < 26; k++) {
    if ((v[l][j].second[k] - (i == 0 ? 0 : v[l][i - 1].second[k])) & 1) {
      o++;
      if (o > 1) return 0;
    }
  }
  return 1;
}
int main() {
  std::ios::sync_with_stdio(false);
  scanf("%d%d", &n, &m);
  g.resize(n);
  for (int i = 1, x; i < n; i++) {
    scanf("%d", &x);
    x--;
    g[i].push_back(x);
    g[x].push_back(i);
  }
  scanf("%s", c);
  t = 0;
  dpth[0] = 1;
  dfs(0, -1);
  v.resize(d + 1);
  dfs2(0, -1);
  int u, h;
  while (m--) {
    scanf("%d%d", &u, &h);
    u--;
    if (dpth[u] > h || h > d) {
      puts("Yes");
      continue;
    }
    int w, l = 0, r = v[h].size() - 1, m, a = -1, b = -1;
    while (l <= r) {
      m = (l + r) / 2;
      w = v[h][m].first;
      if (s[w] >= s[u] && e[w] <= e[u]) {
        a = m;
        r = m - 1;
      } else if (s[w] < s[u])
        l = m + 1;
      else
        r = m - 1;
    }
    l = 0, r = v[h].size() - 1;
    while (l <= r) {
      m = (l + r) / 2;
      w = v[h][m].first;
      if (s[w] >= s[u] && e[w] <= e[u]) {
        b = m;
        l = m + 1;
      } else if (s[w] < s[u])
        l = m + 1;
      else
        r = m - 1;
    }
    if (a == -1 || b == -1) {
      puts("Yes");
      continue;
    }
    if (check(h, a, b))
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
