#include <bits/stdc++.h>
using namespace std;
void syn() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
}
vector<int> adj[500001];
vector<int> depth[500001];
int disc[500001], fin[500001], tim, n, m, dpt[500001];
void dfs(int x, int d) {
  disc[x] = tim++;
  depth[d].push_back(x);
  dpt[x] = d;
  for (auto y : adj[x]) dfs(y, d + 1);
  fin[x] = tim++;
}
map<pair<int, int>, int> M;
string second;
void solve(int v, int h) {
  if (dpt[v] >= h) {
    cout << "Yes\n";
    return;
  }
  int lo = 0, hi = depth[h].size() - 1, mid, l, r;
  l = r = -1;
  while (lo <= hi) {
    mid = (lo + hi) >> 1;
    int x = depth[h][mid];
    if (disc[x] >= disc[v] && fin[x] <= fin[v]) {
      l = mid;
      hi = mid - 1;
    } else if (disc[x] < disc[v])
      lo = mid + 1;
    else
      hi = mid - 1;
  }
  if (l == -1) {
    M[make_pair(v, h)] = 1;
    cout << "Yes\n";
    return;
  }
  lo = l;
  hi = depth[h].size() - 1;
  while (lo <= hi) {
    mid = (lo + hi) >> 1;
    int x = depth[h][mid];
    if (disc[x] >= disc[v] && fin[x] <= fin[v]) {
      r = mid;
      lo = mid + 1;
    } else if (disc[x] < disc[v])
      lo = mid + 1;
    else
      hi = mid - 1;
  }
  if (r == -1) {
    M[make_pair(v, h)] = 1;
    cout << "Yes\n";
    return;
  }
  vector<int> cnt(26, 0);
  int i;
  for (i = l; i <= r; i++) cnt[second[depth[h][i] - 1] - 'a'] ^= 1;
  int z = 0;
  for (i = 0; i < 26; i++)
    if (cnt[i]) z++;
  if (z > 1) {
    M[make_pair(v, h)] = -1;
    cout << "No\n";
    return;
  } else {
    M[make_pair(v, h)] = 1;
    cout << "Yes\n";
    return;
  }
}
int main() {
  syn();
  tim = 1;
  cin >> n >> m;
  int i, x, v, h;
  for (i = 2; i <= n; i++) {
    cin >> x;
    adj[x].push_back(i);
  }
  cin >> second;
  dfs(1, 1);
  while (m--) {
    cin >> v >> h;
    if (M[make_pair(v, h)] == 1)
      cout << "Yes\n";
    else if (M[make_pair(v, h)] == -1)
      cout << "No\n";
    else
      solve(v, h);
  }
}
