#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 5, N = 5e5 + 5, mod = 1e9 + 7, M = 1e4 + 5,
                LOG = 18;
long long n, m, cnt[N][26], sz[N], d[N], ans[N];
char letter[N];
vector<pair<int, int> > q[N];
vector<int> g[N];
void calc(int v, int p) {
  sz[v] = 1;
  d[v] = d[p] + 1;
  for (auto to : g[v]) {
    if (to == p) continue;
    calc(to, v);
    sz[v] += sz[to];
  }
}
void add(int v, int p) {
  cnt[d[v]][letter[v] - 'a']++;
  for (auto to : g[v]) {
    if (to == p) continue;
    add(to, v);
  }
}
void del(int v, int p) {
  cnt[d[v]][letter[v] - 'a']--;
  for (auto to : g[v]) {
    if (to == p) continue;
    del(to, v);
  }
}
void dfs(int v, int p, int keep) {
  int bigchild = -1, mx_sz = 0;
  for (auto to : g[v]) {
    if (to == p) continue;
    if (sz[to] > mx_sz) {
      mx_sz = sz[to];
      bigchild = to;
    }
  }
  for (auto to : g[v]) {
    if (to == p || to == bigchild) continue;
    dfs(to, v, 0);
  }
  if (bigchild != -1) {
    dfs(bigchild, v, 1);
  }
  cnt[d[v]][letter[v] - 'a']++;
  for (auto to : g[v]) {
    if (to == p || to == bigchild) continue;
    add(to, v);
  }
  for (auto to : q[v]) {
    int h = to.first, idx = to.second;
    if (h < d[v]) {
      ans[idx] = 1;
      continue;
    }
    int col = 0;
    for (int i = 0; i <= 25; i++) {
      col += (cnt[h][i] % 2);
    }
    if (col <= 1) ans[idx] = 1;
  }
  if (keep == 0) {
    del(v, p);
  }
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 2; i <= n; i++) {
    int v;
    scanf("%d", &v);
    g[i].push_back(v);
    g[v].push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    cin >> letter[i];
  }
  calc(1, 1);
  for (int i = 1; i <= m; i++) {
    int v, h;
    scanf("%d %d", &v, &h);
    q[v].push_back({h, i});
  }
  dfs(1, 1, 1);
  for (int i = 1; i <= m; i++) {
    if (ans[i])
      printf("Yes\n");
    else
      printf("No\n");
  }
}
