#include <bits/stdc++.h>
using namespace std;
const int N = 510000;
const int inf = 0x3f3f3f3f;
vector<int> edge[N];
vector<pair<int, int> > h[N];
int st[N], ed[N], dfn;
char s[N];
void dfs(int u, int d) {
  st[u] = ++dfn;
  h[d].push_back(make_pair(dfn, h[d].back().second ^ (1 << (s[u] - 'a'))));
  for (int i = 0; i < edge[u].size(); i++) {
    int v = edge[u][i];
    dfs(v, d + 1);
  }
  ed[u] = dfn;
}
int main() {
  int n, m, x, y;
  scanf("%d%d", &n, &m);
  for (int i = 2; i <= n; i++) {
    scanf("%d", &x);
    edge[x].push_back(i);
  }
  for (int i = 1; i <= n; i++) h[i].push_back(make_pair(0, 0));
  scanf("%s", s + 1);
  dfs(1, 1);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &x, &y);
    int l = lower_bound(h[y].begin(), h[y].end(), make_pair(st[x], inf)) -
            h[y].begin();
    int r = upper_bound(h[y].begin(), h[y].end(), make_pair(ed[x], inf)) -
            h[y].begin() - 1;
    x = h[y][r].second ^ h[y][l - 1].second;
    x -= x & (-x);
    if (!x)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
