#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500001;
struct edge {
  int v, nxt;
  edge(int v_ = 0, int nxt_ = 0) {
    v = v_;
    nxt = nxt_;
  }
} e[MAXN];
struct ques {
  int dep, id;
  ques(int dep_ = 0, int id_ = 0) {
    dep = dep_;
    id = id_;
  }
};
vector<int> tmp[MAXN];
vector<ques> q[MAXN];
int n, m, num, head[MAXN], ans[MAXN], cnt[MAXN];
char st[MAXN];
void add_edge(int u, int v) {
  e[++num] = edge(v, head[u]);
  head[u] = num;
}
void dfs(int u, int d) {
  cnt[d] = cnt[d] ^ (1 << (st[u] - 'a'));
  for (int i = 0; i < q[u].size(); i++) tmp[u].push_back(cnt[q[u][i].dep]);
  for (int i = head[u]; ~i; i = e[i].nxt) dfs(e[i].v, d + 1);
  for (int i = 0; i < q[u].size(); i++)
    ans[q[u][i].id] = (tmp[u][i] ^ cnt[q[u][i].dep]);
}
int main() {
  memset(head, -1, sizeof(head));
  scanf("%d%d", &n, &m);
  for (int i = 2; i <= n; i++) {
    int fa;
    scanf("%d", &fa);
    add_edge(fa, i);
  }
  scanf("%s", st + 1);
  for (int i = 1; i <= m; i++) {
    int x, d;
    scanf("%d%d", &x, &d);
    q[x].push_back(ques(d, i));
  }
  dfs(1, 1);
  for (int i = 1; i <= m; i++)
    printf((ans[i] == (ans[i] & (-ans[i]))) ? ("Yes\n") : ("No\n"));
}
