#include <bits/stdc++.h>
using namespace std;
vector<int> tree[500001];
char letters[500001];
int depth[500001];
bool big[500001];
int sz[500001];
int repetitions[500001];
int odd[500001];
vector<pair<int, int> > queries[500000];
bool solution[500001];
void predfs(int v, int p, int d) {
  sz[v] = 1;
  depth[v] = d;
  for (auto u : tree[v]) {
    if (u != p) {
      predfs(u, v, d + 1);
      sz[v] += sz[u];
    }
  }
}
void add(int v, int p, int x) {
  (repetitions[depth[v]] ^= (1ll << letters[v] - 'a'));
  if ((repetitions[depth[v]] & (1ll << letters[v] - 'a'))) {
    odd[depth[v]]++;
  } else {
    odd[depth[v]]--;
  }
  for (auto u : tree[v])
    if (u != p && !big[u]) add(u, v, x);
}
void dfs(int v, int p, bool keep) {
  int mx = -1, bigChild = -1;
  for (auto u : tree[v])
    if (u != p && sz[u] > mx) mx = sz[u], bigChild = u;
  for (auto u : tree[v])
    if (u != p && u != bigChild) dfs(u, v, 0);
  if (bigChild != -1) dfs(bigChild, v, 1), big[bigChild] = 1;
  add(v, p, 1);
  for (int i = 0; i < queries[v].size(); i++) {
    if (odd[queries[v][i].first] <= 1) {
      solution[queries[v][i].second] = true;
    } else {
      solution[queries[v][i].second] = false;
    }
  }
  if (bigChild != -1) big[bigChild] = 0;
  if (keep == 0) add(v, p, -1);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  int n, m;
  cin >> n >> m;
  for (int i = 1; i < n; i++) {
    int p;
    cin >> p;
    p--;
    tree[p].push_back(i);
  }
  predfs(0, -1, 1);
  for (int i = 0; i < n; i++) {
    cin >> letters[i];
  }
  for (int i = 0; i < m; i++) {
    int v, h;
    cin >> v >> h;
    v--;
    queries[v].push_back(make_pair(h, i));
  }
  dfs(0, -1, true);
  for (int i = 0; i < m; i++) {
    if (solution[i]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
