#include <bits/stdc++.h>
using namespace std;
const int LIM = 5e+5 + 10;
const int root = 0;
struct vert_item {
  int tin, vert, pref;
  vert_item() {}
  vert_item(int tin, int v, int pref) : tin(tin), vert(v), pref(pref) {}
};
vector<vector<vert_item>> vert(LIM, vector<vert_item>());
vector<vector<int>> g(LIM, vector<int>());
vector<int> tin(LIM);
vector<int> tout(LIM);
int timer = 0;
string s;
int cnt_bits(int val) {
  int res = 0;
  for (int i = 0; i < 26; ++i)
    if (val & (1 << i)) ++res;
  return res;
}
void dfs(int v, int h) {
  ++timer;
  tin[v] = timer;
  vert[h].push_back(vert_item(timer, v, 0));
  for (int u : g[v]) dfs(u, h + 1);
  ++timer;
  tout[v] = timer;
}
inline void set_xor(int& val, int bit) { val = val ^ (1 << bit); }
void gen_pref() {
  for (int h = 0; h < LIM; ++h)
    for (int id = 0; id < (int)vert[h].size(); ++id) {
      if (id > 0) vert[h][id].pref = vert[h][id - 1].pref;
      set_xor(vert[h][id].pref, s[vert[h][id].vert] - 'a');
    }
}
int get_left(vector<vert_item>& v, int val) {
  int l = 0, r = v.size() - 1;
  while (l <= r) {
    int m = (l + r) / 2;
    if (v[m].tin > val) {
      r = m - 1;
    } else {
      l = m + 1;
    }
  }
  return l;
}
int get_right(vector<vert_item>& v, int val) {
  int l = 0, r = v.size() - 1;
  while (l <= r) {
    int m = (l + r) / 2;
    if (v[m].tin > val) {
      r = m - 1;
    } else {
      l = m + 1;
    }
  }
  return r;
}
int get_pref_xor(int h, int l, int r) {
  if (l == 0) return vert[h][r].pref;
  return vert[h][r].pref ^ vert[h][l - 1].pref;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i < n; ++i) {
    int p;
    cin >> p;
    --p;
    g[p].push_back(i);
  }
  cin >> s;
  dfs(root, 1);
  gen_pref();
  for (int q = 0; q < m; ++q) {
    int v, h;
    cin >> v >> h;
    --v;
    int l = get_left(vert[h], tin[v]);
    if (l == (int)vert[h].size()) {
      cout << "Yes\n";
      continue;
    }
    int r = get_right(vert[h], tout[v]);
    if (r == -1) {
      cout << "Yes\n";
      continue;
    }
    if (cnt_bits(get_pref_xor(h, l, r)) <= 1)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
