#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 5;
vector<int> adj[MAXN];
char a[MAXN];
int sz[MAXN], h[MAXN];
int n, m;
vector<pair<int, int>> q[MAXN];
bool ans[MAXN];
void get_sz(int v, int pre) {
  for (int u : adj[v])
    if (pre != u) {
      h[u] = h[v] + 1;
      get_sz(u, v);
      sz[v] += sz[u];
    }
  ++sz[v];
}
int cnt[MAXN][50];
vector<int> *vec[MAXN];
bool check(int hight) {
  int odd = 0;
  for (int i = 0; i < 50; ++i) odd += (cnt[hight][i] & 1);
  return odd < 2;
}
void DFS(int v, int pre, int type) {
  int mx = -1, mx_v = -1;
  for (int i : adj[v])
    if (i != pre && mx < sz[i]) {
      mx = sz[i];
      mx_v = i;
    }
  for (int i : adj[v])
    if (pre != i && i != mx_v) DFS(i, v, 0);
  if (mx_v != -1)
    DFS(mx_v, v, 1), vec[v] = vec[mx_v];
  else
    vec[v] = new vector<int>();
  vec[v]->push_back(v);
  cnt[h[v]][a[v] - 'a']++;
  for (int i : adj[v])
    if (i != pre && i != mx_v)
      for (int u : *vec[i]) {
        ++cnt[h[u]][a[u] - 'a'];
        vec[v]->push_back(u);
      }
  for (auto y : q[v]) {
    ans[y.second] = check(y.first);
  }
  if (!type) {
    for (int i : *vec[v]) --cnt[h[i]][a[i] - 'a'];
  }
}
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  for (int i = 2; i <= n; i++) {
    int x;
    cin >> x;
    adj[x].push_back(i);
    adj[i].push_back(x);
  }
  for (int i = 1; i <= n; ++i) cin >> a[i];
  h[1] = 1;
  get_sz(1, -1);
  for (int i = 0; i < m; ++i) {
    int vi, hi;
    cin >> vi >> hi;
    q[vi].push_back({hi, i});
  }
  DFS(1, -1, 1);
  for (int i = 0; i < m; ++i) cout << (ans[i] ? "Yes\n" : "No\n");
}
