#include <bits/stdc++.h>
using namespace std;
const int ALFA = 26;
const int N = 500010;
char ch[N];
vector<int> graph[N];
vector<pair<int, int> > queries[N];
int height[N], son[N], sz[N];
void dfs(int u) {
  sz[u] = 1;
  son[u] = -1;
  int max_sz = 0;
  for (int v : graph[u]) {
    height[v] = height[u] + 1;
    dfs(v);
    sz[u] += sz[v];
    if (sz[v] > max_sz) {
      son[u] = v;
      max_sz = sz[v];
    }
  }
}
bool ans[N];
int t_freq[N];
int l_freq[N][ALFA];
vector<int>* vis[N];
void update(int u, int val) {
  int& x = l_freq[height[u]][ch[u] - 'a'];
  x += val;
  if (x & 1)
    ++t_freq[height[u]];
  else
    --t_freq[height[u]];
}
void solve(int u, bool keep) {
  for (int v : graph[u])
    if (v != son[u]) solve(v, false);
  if (son[u] == -1)
    vis[u] = new vector<int>();
  else {
    solve(son[u], true);
    vis[u] = vis[son[u]];
  }
  update(u, 1);
  vis[u]->push_back(u);
  for (int v : graph[u])
    if (v != son[u])
      for (int w : *vis[v]) {
        update(w, 1);
        vis[u]->push_back(w);
      }
  for (pair<int, int> q : queries[u]) ans[q.second] = (t_freq[q.first] <= 1);
  if (!keep)
    for (int v : *vis[u]) update(v, -1);
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 2; i <= n; i++) {
    int p;
    scanf("%d", &p);
    graph[p].push_back(i);
  }
  scanf("%s", ch + 1);
  for (int i = 0; i < m; i++) {
    int v, h;
    scanf("%d %d", &v, &h);
    queries[v].push_back({h - 1, i});
  }
  dfs(1);
  solve(1, false);
  for (int i = 0; i < m; i++) printf("%s\n", ans[i] ? "Yes" : "No");
  return 0;
}
