#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
int tot;
char s[N];
int fir[N], dep[N], ans[N], cnt[N];
vector<int> pre[N];
vector<pair<int, int> > query[N];
struct edge {
  int to;
  int nxt;
} e[2 * N];
inline void add(int x, int y) {
  e[++tot].to = y;
  e[tot].nxt = fir[x];
  fir[x] = tot;
  e[++tot].to = x;
  e[tot].nxt = fir[y];
  fir[y] = tot;
}
inline void dfs(int p, int fa) {
  cnt[dep[p]] ^= (1 << (s[p] - 'a'));
  for (int i = 0; i < query[p].size(); i++)
    pre[p].push_back(cnt[query[p][i].first]);
  for (int i = fir[p]; i; i = e[i].nxt) {
    int q = e[i].to;
    if (q == fa) continue;
    dep[q] = dep[p] + 1;
    dfs(q, p);
  }
  for (int i = 0; i < query[p].size(); i++)
    ans[query[p][i].second] = (pre[p][i] ^ cnt[query[p][i].first]);
}
int main() {
  int n, m, a, b;
  scanf("%d%d", &n, &m);
  for (int i = 2; i <= n; i++) {
    scanf("%d", &a);
    add(a, i);
  }
  scanf("%s", s + 1);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &a, &b);
    query[a].push_back(make_pair(b, i));
  }
  dep[1] = 1, dfs(1, 0);
  for (int i = 1; i <= m; i++) {
    if (!ans[i] || (ans[i] && (ans[i] & (ans[i] - 1)) == 0))
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
