#include <bits/stdc++.h>
using namespace std;
const int MAXN = 500005;
int depth[MAXN], maxdepth[MAXN], ans[MAXN];
char c[MAXN];
vector<int> adj[MAXN], subtree[MAXN];
vector<pair<int, int> > query[MAXN];
void dfsSz(int now) {
  for (auto nxt : adj[now]) {
    depth[nxt] = depth[now] + 1;
    dfsSz(nxt);
    maxdepth[now] = max(maxdepth[now], maxdepth[nxt]);
  }
  maxdepth[now] = max(maxdepth[now], depth[now]);
}
void dfs(int now) {
  for (auto nxt : adj[now]) {
    dfs(nxt);
    if (subtree[nxt].size() > subtree[now].size())
      subtree[now].swap(subtree[nxt]);
    for (int i = 1; i <= subtree[nxt].size(); i++) {
      subtree[now][subtree[now].size() - i] ^=
          subtree[nxt][subtree[nxt].size() - i];
    }
  }
  subtree[now].push_back(1 << (c[now] - 'a'));
  for (auto isi : query[now]) {
    if (maxdepth[now] < isi.first || isi.first < depth[now] ||
        __builtin_popcount(subtree[now][maxdepth[now] - isi.first]) <= 1)
      ans[isi.second] = 1;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, p, a;
  cin >> n >> m;
  for (int i = 2; i <= n; i++) {
    cin >> p;
    adj[p].push_back(i);
  }
  for (int i = 1; i <= n; i++) cin >> c[i];
  depth[1] = 1;
  dfsSz(1);
  for (int i = 1; i <= m; i++) {
    cin >> p >> a;
    query[p].push_back({a, i});
  }
  dfs(1);
  for (int i = 1; i <= m; i++) {
    if (ans[i])
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
