#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, i, j, k, id, ct, v, hh, a, b, c, x, y, d;
  string s;
  cin >> n >> m;
  vector<int> parent(n + 1);
  vector<int> h(n + 1);
  vector<vector<int>> adj(n + 1);
  parent[1] = -1;
  h[1] = 1;
  for (i = 2; i <= n; i++) {
    cin >> parent[i];
    adj[parent[i]].push_back(i);
    h[i] = h[parent[i]] + 1;
  }
  cin >> s;
  vector<int> in(n + 1, -1), out(n + 1, -1);
  vector<vector<pair<int, int>>> hlist(500310);
  ct = 0;
  stack<int> st;
  st.push(1);
  while (!st.empty()) {
    id = st.top();
    if (in[id] == -1) {
      ct++;
      in[id] = ct;
      if (hlist[h[id]].empty()) hlist[h[id]].push_back({0, 0});
      hlist[h[id]].push_back(
          {in[id], hlist[h[id]][hlist[h[id]].size() - 1].second ^
                       (1 << (s[id - 1] - 'a'))});
      for (auto p : adj[id]) st.push(p);
    } else {
      out[id] = ct;
      st.pop();
    }
  }
  while (m--) {
    cin >> v >> hh;
    bool ans;
    if (hlist[hh].empty())
      ans = true;
    else {
      a = 0;
      b = hlist[hh].size() - 1;
      while (a < b) {
        c = (a + b) / 2;
        if (hlist[hh][c].first >= in[v])
          b = c;
        else
          a = c + 1;
      }
      x = a;
      a = 0;
      b = hlist[hh].size() - 1;
      while (a < b) {
        c = (a + b + 1) / 2;
        if (hlist[hh][c].first <= out[v])
          a = c;
        else
          b = c - 1;
      }
      y = a;
      if (x > y)
        ans = true;
      else {
        d = hlist[hh][y].second ^ hlist[hh][x - 1].second;
        ct = 0;
        for (i = 0; i < 26; i++) {
          if ((1 << i) & d) ct++;
        }
        ans = (ct < 2);
      }
    }
    if (ans)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
