#include <bits/stdc++.h>
using namespace std;
const long long MAX_N = 1e6 + 5;
const long long MOD = 1e9 + 7;
long long N, M, K;
long long head[MAX_N];
long long tot = 0;
struct Edge {
  long long to, nxt;
} edge[MAX_N];
void addEdge(long long u, long long v) {
  edge[tot].nxt = head[u];
  edge[tot].to = v;
  head[u] = tot++;
}
long long son[MAX_N];
long long dep[MAX_N];
long long sz[MAX_N];
void dfs(long long u, long long d) {
  sz[u] = 1;
  son[u] = 0;
  dep[u] = d;
  long long v;
  for (long long i = head[u]; ~i; i = edge[i].nxt) {
    dfs(v = edge[i].to, d + 1);
    sz[u] += sz[v];
    if (sz[v] > sz[son[u]]) {
      son[u] = v;
    }
  }
}
long long arr[MAX_N];
bool ans[MAX_N];
struct Qr {
  long long id, k;
};
short cnt[MAX_N][30];
vector<Qr> qr[MAX_N];
void update(long long u, long long v) { cnt[dep[u]][arr[u]] += v; }
void calc(long long u) {
  update(u, 1);
  for (long long i = head[u]; ~i; i = edge[i].nxt) {
    calc(edge[i].to);
  }
}
void del(long long u) {
  update(u, -1);
  for (long long i = head[u]; ~i; i = edge[i].nxt) {
    del(edge[i].to);
  }
}
void get_ans(long long u) {
  long long d = 0;
  long long ji = 0;
  for (Qr q : qr[u]) {
    d = q.k;
    ji = 0;
    if (d < dep[u]) {
      ans[q.id] = 1;
      continue;
    }
    for (long long i = 0; i < 27; ++i) {
      ji += cnt[d][i] & 1;
    }
    ans[q.id] = ji <= 1;
  }
}
void dsu(long long u, long long opt) {
  for (long long i = head[u]; ~i; i = edge[i].nxt) {
    if (edge[i].to != son[u]) dsu(edge[i].to, 1);
  }
  if (son[u]) dsu(son[u], 0);
  update(u, 1);
  for (long long i = head[u]; ~i; i = edge[i].nxt) {
    if (edge[i].to != son[u]) calc(edge[i].to);
  }
  get_ans(u);
  if (opt) del(u);
}
char s[MAX_N];
void init() {
  memset(head, -1, sizeof head);
  tot = 0;
}
void solve() {
  init();
  scanf("%lld%lld", &N, &M);
  long long u, v;
  for (long long i = 2; i <= N; ++i) {
    v = i;
    scanf("%lld", &u);
    addEdge(u, v);
  }
  scanf("%s", s + 1);
  for (long long i = 1; i <= N; ++i) {
    arr[i] = s[i] - 'a';
  }
  for (long long i = 1; i <= M; ++i) {
    scanf("%lld%lld", &u, &v);
    qr[u].push_back({i, v});
  }
  dfs(1, 1);
  dsu(1, 0);
  for (long long i = 1; i <= M; ++i) {
    if (ans[i])
      puts("Yes");
    else
      puts("No");
  }
}
signed main() {
  long long T = 1;
  while (T--) solve();
  return 0;
}
