#include <bits/stdc++.h>
using namespace std;
int n, m, times[2][500100], timeG = 0;
vector<vector<int> > g;
vector<vector<pair<int, int> > > trick;
string s;
void dfs(int u, int h) {
  times[0][u] = ++timeG;
  int letter = 1 << (s[u] - 'a');
  pair<int, int> x = {timeG, letter ^ trick[h].back().second};
  trick[h].push_back(x);
  for (auto it : g[u]) {
    dfs(it, h + 1);
  }
  times[1][u] = ++timeG;
}
int main(int argc, char const* argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  g.assign(n + 1, vector<int>());
  trick.assign(n + 1, vector<pair<int, int> >());
  for (int i = 0; i < n - 1; ++i) {
    trick[i].resize(1);
    int p;
    cin >> p;
    g[p - 1].push_back(i + 1);
  }
  trick[n - 1].resize(1);
  cin >> s;
  dfs(0, 0);
  for (int i = 0; i < m; ++i) {
    int v, h;
    cin >> v >> h;
    --v;
    --h;
    int en = times[0][v], ex = times[1][v];
    int start =
            lower_bound(trick[h].begin(), trick[h].end(), make_pair(en, -1)) -
            trick[h].begin() - 1,
        end = lower_bound(trick[h].begin(), trick[h].end(), make_pair(ex, -1)) -
              trick[h].begin() - 1;
    int t = trick[h][start].second ^ trick[h][end].second;
    if (t - (t & -t))
      cout << "No\n";
    else
      cout << "Yes\n";
  }
  return 0;
}
