#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
vector<int> adj[N], pref[N], lvl_tym[N];
int d[N], in[N], out[N], tym = 1;
string str;
void dfs(int u, int p) {
  d[u] = d[p] + 1;
  in[u] = tym++;
  lvl_tym[d[u]].push_back(in[u]);
  pref[d[u]].push_back(pref[d[u]].back() ^ (1 << (str[u - 1] - 'a')));
  for (auto v : adj[u]) {
    if (v == p) continue;
    dfs(v, u);
  }
  out[u] = tym - 1;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 2; i <= n; i++) {
    int p;
    cin >> p;
    adj[p].push_back(i);
  }
  for (int i = 0; i <= n; i++) {
    lvl_tym[i].push_back(0);
    pref[i].push_back(0);
  }
  cin >> str;
  dfs(1, 0);
  for (int i = 0; i < m; i++) {
    int v, h;
    cin >> v >> h;
    int l = lower_bound(lvl_tym[h].begin(), lvl_tym[h].end(), in[v]) -
            lvl_tym[h].begin();
    int r = upper_bound(lvl_tym[h].begin(), lvl_tym[h].end(), out[v]) -
            lvl_tym[h].begin() - 1;
    int x = pref[h][r] ^ pref[h][l - 1];
    if (__builtin_popcount(x) <= 1)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
