#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 5;
struct node {
  int dep, id;
};
vector<int> e[maxn];
vector<struct node> q[maxn];
vector<int> pre[maxn];
int c[maxn];
int dep[maxn];
int res[maxn];
char s[maxn];
void update(int u) {
  int i = s[u] - 'a';
  c[dep[u]] ^= (1 << i);
}
void dfs(int u, int fa) {
  dep[u] = dep[fa] + 1;
  update(u);
  for (auto t : q[u]) pre[u].push_back(c[t.dep]);
  for (auto v : e[u]) {
    if (v == fa) continue;
    dfs(v, u);
  }
  int qsz = q[u].size();
  for (int i = 0; i < qsz; i++) {
    int dep = q[u][i].dep;
    int id = q[u][i].id;
    res[id] = (pre[u][i] ^ c[dep]);
  }
}
bool bitcount(int x) {
  int res = 0;
  for (int i = 31; i >= 0; i--)
    if ((x >> i) & 1) res++;
  return res <= 1;
}
int main(void) {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 2; i <= n; i++) {
    int fa;
    scanf("%d", &fa);
    e[fa].push_back(i);
  }
  scanf("%s", s + 1);
  for (int i = 1; i <= m; i++) {
    int v, d;
    scanf("%d%d", &v, &d);
    q[v].push_back((node){d, i});
  }
  dep[0] = 0;
  dfs(1, 0);
  for (int i = 1; i <= m; i++) printf("%s\n", bitcount(res[i]) ? "Yes" : "No");
  return 0;
}
