#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 5;
struct ii {
  int a, b;
};
int cnt_time, N, Q, st[MAXN], ft[MAXN], sz[MAXN], cnt[MAXN][30], cnt_odd[MAXN],
    h[MAXN], ver[MAXN];
bitset<MAXN> ans;
vector<int> edge[MAXN];
vector<ii> q[MAXN];
string huruf;
void getsz(int now) {
  st[now] = ++cnt_time;
  ver[cnt_time] = now;
  sz[now] = 1;
  for (auto i : edge[now]) {
    h[i] = h[now] + 1;
    getsz(i);
    sz[now] += sz[i];
  }
  ft[now] = cnt_time;
}
void add(int now, int v) {
  cnt_odd[h[now]] -= cnt[h[now]][huruf[now] - 'a'] & 1;
  cnt[h[now]][huruf[now] - 'a'] += v;
  cnt_odd[h[now]] += cnt[h[now]][huruf[now] - 'a'] & 1;
}
void dfs(int now, int keep) {
  int big = -1;
  for (auto i : edge[now]) {
    if (big == -1 || sz[i] > sz[big]) big = i;
  }
  for (auto i : edge[now]) {
    if (i == big) continue;
    dfs(i, 0);
  }
  if (big != -1) dfs(big, 1);
  for (auto i : edge[now]) {
    if (i == big) continue;
    for (int j = st[i]; j <= ft[i]; j++) {
      add(ver[j], 1);
    }
  }
  add(now, 1);
  for (auto i : q[now]) {
    ans[i.b] = cnt_odd[i.a] <= 1;
  }
  if (!keep) {
    for (int i = st[now]; i <= ft[now]; i++) {
      add(ver[i], -1);
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> Q;
  for (int i = 1; i < N; i++) {
    int x;
    cin >> x;
    x--;
    edge[x].push_back(i);
  }
  cin >> huruf;
  for (int i = 0; i < Q; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    q[x].push_back({y, i});
  }
  h[0] = 1;
  getsz(0);
  dfs(0, 1);
  for (int i = 0; i < Q; i++) cout << (ans[i] ? "Yes" : "No") << "\n";
  return 0;
}
