#include <bits/stdc++.h>
using namespace std;
int n, m, sz[500005], ans[500005], mxc[500005], lvl[500005], cnt[500005][30],
    cntfull[500005];
bool big[500005];
char c[500005];
vector<int> v[500005];
vector<pair<int, int> > ask[500005];
int getsz(int q) {
  sz[q] = 1;
  int mx = 0, idx;
  for (auto it : v[q]) {
    lvl[it] = lvl[q] + 1;
    int tt = getsz(it);
    if (tt > mx) mx = tt, idx = it;
    sz[q] += tt;
  }
  if (mx) mxc[q] = idx;
  return sz[q];
}
void add(int q) {
  cntfull[lvl[q]] -= cnt[lvl[q]][c[q] - 'a'];
  cnt[lvl[q]][c[q] - 'a'] ^= 1;
  cntfull[lvl[q]] += cnt[lvl[q]][c[q] - 'a'];
  for (auto it : v[q])
    if (!big[it]) add(it);
}
void dfs(int q, bool keep) {
  for (auto it : v[q])
    if (it != mxc[q]) dfs(it, 0);
  if (mxc[q]) big[mxc[q]] = 1, dfs(mxc[q], 1);
  add(q);
  for (auto it : ask[q]) ans[it.second] = (cntfull[it.first] < 2);
  if (mxc[q]) big[mxc[q]] = 0;
  if (!keep) add(q);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 2, x; i <= n; i++) cin >> x, v[x].push_back(i);
  for (int i = 1; i <= n; i++) cin >> c[i];
  for (int i = 1, ver, lv; i <= m; i++) {
    cin >> ver >> lv;
    ask[ver].push_back({lv, i});
  }
  lvl[1] = 1;
  getsz(1);
  dfs(1, 0);
  for (int i = 1; i <= m; i++) cout << (ans[i] ? "Yes" : "No") << '\n';
  return 0;
}
