#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fll;
int ct = 0;
vector<int> L, R, d;
void dfs(const vector<vector<int> >& E, int u) {
  L[u] = ct++;
  for (auto v : E[u]) {
    d[v] = 1 + d[u];
    dfs(E, v);
  }
  R[u] = ct;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<vector<int> > E(n);
  for (int u = 1; u < n; ++u) {
    int v;
    cin >> v;
    --v;
    E[v].push_back(u);
  }
  L.assign(n, 0), R.assign(n, 0), d.assign(n, 1);
  dfs(E, 0);
  vector<int> first(n);
  for (int i = 0; i < n; ++i) {
    char c;
    cin >> c;
    first[i] = 1 << (c - 'a');
  }
  vector<int> I(n, 0);
  iota(I.begin(), I.end(), 0);
  sort(I.begin(), I.end(), [](int u, int v) {
    return make_pair(d[u], L[u]) < make_pair(d[v], L[v]);
  });
  vector<pair<int, int> > info(n);
  for (int i = 0; i < n; ++i) info[i] = make_pair(d[I[i]], L[I[i]]);
  vector<int> XOR(n, 0);
  XOR[0] = first[I[0]];
  for (int u = 1; u < n; ++u) XOR[u] = first[I[u]] ^ XOR[u - 1];
  for (int j = 0; j < m; ++j) {
    int v, h;
    cin >> v >> h;
    --v;
    auto l = lower_bound(info.begin(), info.end(), make_pair(h, L[v]));
    auto r = upper_bound(info.begin(), info.end(), make_pair(h, R[v] - 1));
    int X = XOR[distance(info.begin(), --r)];
    if (l != info.begin()) X ^= XOR[distance(info.begin(), --l)];
    if (__builtin_popcount(X) <= 1)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  exit(0);
}
