#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3fffffff;
const int SINF = 0x7fffffff;
const long long LINF = 0x3fffffffffffffff;
const long long SLINF = 0x7fffffffffffffff;
const int MAXN = 500007;
const char BASE = 26;
struct eT {
  void setd(int _u, int _v, int _l) { u = _u, v = _v, last = _l; }
  int u, v, last;
} edge[MAXN];
int n, q, ke, pc, rt, ht;
int la[MAXN], fa[MAXN];
int pre[MAXN], id[MAXN], lev[MAXN], il[MAXN], ir[MAXN];
int nl[MAXN];
int cc[MAXN][BASE];
char s[MAXN];
set<int> pl[MAXN];
set<int>::iterator itl, itr;
void init();
void input();
void inputq();
void work();
void dfs(int now, int tl);
int main() {
  init();
  input();
  work();
}
void init() { ios::sync_with_stdio(false); }
void input() {
  scanf("%d%d", &n, &q);
  for (int i = 2; i <= n; ++i) scanf("%d", &fa[i]);
  scanf("%s", s + 1);
  s[0] = ' ';
}
void inputq() { scanf("%d%d", &rt, &ht); }
void work() {
  ke = 0;
  memset(la, -1, sizeof(la));
  for (int i = 2; i <= n; ++i) {
    edge[ke].setd(fa[i], i, la[fa[i]]);
    la[fa[i]] = ke++;
  }
  pc = 1;
  dfs(1, 1);
  memset(cc, 0, sizeof(cc));
  for (int i = 1; i <= n; ++i) {
    pl[i].insert(0), pl[i].insert(n + 1);
  }
  memset(nl, 0, sizeof(nl));
  int nc, lst;
  for (int i = 1; i <= n; ++i) {
    nc = s[id[i]] - 'a';
    lst = nl[lev[i]];
    for (int j = 0; j < BASE; ++j) cc[i][j] = cc[lst][j];
    ++cc[i][nc];
    pl[lev[i]].insert(i);
    nl[lev[i]] = i;
  }
  int l, r;
  int flag;
  for (int _q = 0; _q < q; ++_q) {
    inputq();
    itl = pl[ht].lower_bound(il[rt]);
    --itl;
    itr = pl[ht].upper_bound(ir[rt]);
    --itr;
    l = *itl, r = *itr;
    flag = 2;
    for (int i = 0; i < BASE; ++i)
      if ((cc[r][i] - cc[l][i]) & 1) --flag;
    printf((flag > 0) ? "Yes\n" : "No\n");
  }
}
void dfs(int now, int tl) {
  pre[now] = pc++;
  id[pre[now]] = now;
  lev[pre[now]] = tl;
  il[now] = ir[now] = pre[now];
  int v;
  for (int i = la[now]; i ^ -1; i = edge[i].last) {
    v = edge[i].v;
    dfs(v, tl + 1);
    ir[now] = (((ir[now]) > (ir[v])) ? (ir[now]) : (ir[v]));
  }
}
