#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T gi() {
  T f = 1, x = 0;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return f * x;
}
const int INF = 0x3f3f3f3f, N = 500003, M = N << 1;
int n, m;
int tot, head[N], ver[M], nxt[M];
char s[N];
vector<pair<int, int> > qry[N];
int fa[N];
int ans[N];
int sz[N], dep[N], son[N];
bool cnt[N][30];
int big;
inline void add(int u, int v) {
  ver[++tot] = v, nxt[tot] = head[u], head[u] = tot;
}
void dfs1(int u) {
  sz[u] = 1, dep[u] = dep[fa[u]] + 1;
  for (int i = head[u]; i; i = nxt[i]) {
    int v = ver[i];
    dfs1(v);
    sz[u] += sz[v];
    if (sz[v] > sz[son[u]]) son[u] = v;
  }
}
void solve(int u) {
  cnt[dep[u]][s[u] - 'a'] ^= 1;
  for (int i = head[u]; i; i = nxt[i]) {
    int v = ver[i];
    if (v == big) continue;
    solve(v);
  }
}
void dfs2(int u, bool del) {
  for (int i = head[u]; i; i = nxt[i]) {
    int v = ver[i];
    if (v == son[u]) continue;
    dfs2(v, 0);
  }
  big = 0;
  if (son[u]) dfs2(son[u], 1), big = son[u];
  solve(u);
  for (auto x : qry[u]) {
    int res = 0;
    for (int i = 0; i < 26; i += 1) res += (cnt[x.second][i] & 1);
    if (res <= 1)
      ans[x.first] = 1;
    else
      ans[x.first] = 0;
  }
  big = 0;
  if (!del) solve(u);
}
int main() {
  n = gi<int>(), m = gi<int>();
  for (int i = 2; i <= n; i += 1) {
    fa[i] = gi<int>();
    add(fa[i], i);
  }
  scanf("%s", s + 1);
  for (int i = 1; i <= m; i += 1) {
    int u = gi<int>(), d = gi<int>();
    qry[u].push_back({i, d});
  }
  dfs1(1);
  dfs2(1, 1);
  for (int i = 1; i <= m; i += 1) puts(ans[i] ? "Yes" : "No");
  return 0;
}
