#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 5e5 + 13;
string s;
int n, m, dp[N], depth[N], o[N], ans[N];
vector<int> g[N];
vector<pair<int, int>> q[N];
map<int, int> cnt[N];
void dfsSz(int v, int d = 1) {
  dp[v] = 1;
  depth[v] = d;
  for (int to : g[v]) {
    dfsSz(to, d + 1);
    dp[v] += dp[to];
  }
}
void add(int v) {
  int d = depth[v];
  if (cnt[d][s[v]] % 2 == 1) o[d]--;
  cnt[d][s[v]]++;
  if (cnt[d][s[v]] % 2 == 1) o[d]++;
}
void del(int v) {
  int d = depth[v];
  if (cnt[d][s[v]] % 2 == 1) o[d]--;
  cnt[d][s[v]]--;
  if (cnt[d][s[v]] % 2 == 1) o[d]++;
}
void go(int v, int t) {
  if (!t)
    add(v);
  else
    del(v);
  for (int to : g[v]) go(to, t);
}
void dfs(int v, bool keep) {
  int node = -1;
  for (int to : g[v]) {
    if (node == -1 || dp[node] < dp[to]) node = to;
  }
  for (int to : g[v]) {
    if (to != node) dfs(to, 0);
  }
  if (node != -1) dfs(node, 1);
  add(v);
  for (int to : g[v]) {
    if (to != node) go(to, 0);
  }
  for (auto it : q[v]) {
    ans[it.second] = (o[it.first] <= 1);
  }
  if (!keep) go(v, 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> m;
  for (int v = 2; v <= n; v++) {
    int u;
    cin >> u;
    g[u].push_back(v);
  }
  cin >> s;
  s = '#' + s;
  for (int i = 0; i < m; i++) {
    int v, h;
    cin >> v >> h;
    q[v].push_back(make_pair(h, i));
  }
  dfsSz(1);
  dfs(1, 0);
  for (int i = 0; i < m; i++) cout << (ans[i] ? "Yes\n" : "No\n");
  return 0;
}
