#include <bits/stdc++.h>
using namespace std;
int debug = 0;
int n, m, timeStamp;
char str[510000];
int maxLv;
int par[510000];
vector<vector<int> > E, BFS_Save;
int L[510000], R[510000], Num[510000];
int arr[500010 * 4], myLv[510000];
void init() {
  timeStamp = 1;
  maxLv = 1;
  E = vector<vector<int> >(n + 2, vector<int>());
  BFS_Save = vector<vector<int> >(n + 2, vector<int>());
}
void BFS() {
  int crt = 0;
  queue<pair<int, int> > Q;
  Q.push(make_pair(1, 1));
  while (!Q.empty()) {
    int rt = Q.front().first, lv = Q.front().second;
    maxLv = max(maxLv, lv);
    Q.pop();
    BFS_Save[lv].push_back(rt);
    myLv[rt] = lv;
    Num[rt] = crt;
    crt++;
    for (int i = 0; i < int(E[rt].size()); i++) {
      int e = E[rt][i];
      if (e != par[rt]) Q.push(make_pair(e, lv + 1));
    }
  }
}
void DFS(int rt) {
  L[rt] = timeStamp++;
  for (int i = 0; i < int(E[rt].size()); i++) {
    int e = E[rt][i];
    if (e != par[rt]) DFS(e);
  }
  R[rt] = timeStamp++;
}
void build(pair<int, int> LR, int rt) {
  arr[rt] = 0;
  int mid = (LR.first + LR.second) / 2;
  if (LR.first != LR.second)
    build(make_pair(LR.first, mid), rt << 1),
        build(make_pair(mid + 1, LR.second), (rt << 1) | 1);
}
void add(long long val, int pos, pair<int, int> LR, int rt) {
  if (LR.first == LR.second) {
    arr[rt] |= val;
    return;
  }
  if (debug) printf("pos %d pI %d %d rt %d\n", pos, LR.first, LR.second, rt);
  int mid = (LR.first + LR.second) / 2;
  if (pos <= mid)
    add(val, pos, make_pair(LR.first, mid), rt * 2);
  else
    add(val, pos, make_pair(mid + 1, LR.second), rt * 2 + 1);
  arr[rt] = arr[rt * 2] ^ arr[rt * 2 + 1];
}
int Q(pair<int, int> LR, pair<int, int> LbR, int rt) {
  if (LR.first == LbR.first && LR.second == LbR.second) return arr[rt];
  int mid = (LbR.first + LbR.second) / 2;
  if (LR.second <= mid)
    return Q(LR, make_pair(LbR.first, mid), rt * 2);
  else if (LR.first > mid)
    return Q(LR, make_pair(mid + 1, LbR.second), rt * 2 + 1);
  else
    return Q(make_pair(LR.first, mid), make_pair(LbR.first, mid), rt * 2) ^
           Q(make_pair(mid + 1, LR.second), make_pair(mid + 1, LbR.second),
             rt * 2 + 1);
}
void Tree_build() {
  build(make_pair(0, n - 1), 1);
  for (int i = 0; i < n; i++) {
    int tem = str[i] - 'a';
    add((1LL << tem), Num[i + 1], make_pair(0, n - 1), 1);
  }
}
bool cmpL(const int &a, const int &b) { return L[a] < L[b]; }
bool cmpR(const int &a, const int &b) { return R[a] < R[b]; }
int main() {
  cin >> n >> m;
  init();
  for (int i = 2; i <= n; i++) {
    int t;
    scanf("%d", &t);
    par[i] = t;
    E[t].push_back(i), E[i].push_back(t);
  }
  cin >> str;
  DFS(1);
  BFS();
  Tree_build();
  if (debug) {
    printf("BFS:\n");
    for (int i = 1; i <= maxLv; i++) {
      printf("Lv %d:", i);
      for (int j = 0; j < int(BFS_Save[i].size()); j++)
        printf(" %d", BFS_Save[i][j]);
      puts("");
    }
    printf("DFS:\n");
    for (int i = 1; i <= n; i++) printf("i %d: L %d R %d\n", i, L[i], R[i]);
  }
  while (m--) {
    bool flag = false;
    int rt, subLv;
    scanf("%d %d", &rt, &subLv);
    if (subLv <= myLv[rt])
      flag = true;
    else {
      int aI = int(lower_bound(BFS_Save[subLv].begin(), BFS_Save[subLv].end(),
                               rt, cmpL) -
                   BFS_Save[subLv].begin());
      int bI = int(lower_bound(BFS_Save[subLv].begin(), BFS_Save[subLv].end(),
                               rt, cmpR) -
                   BFS_Save[subLv].begin());
      if (aI != bI) {
        int valA = BFS_Save[subLv][aI];
        int valB = BFS_Save[subLv][bI - 1];
        int oddCnt = 0;
        if (debug) printf("valA %d B %d\n", valA, valB);
        long long now =
            Q(make_pair(Num[valA], Num[valB]), make_pair(0, n - 1), 1);
        while (now) {
          oddCnt++;
          now ^= (now & (-now));
        }
        if (oddCnt <= 1) flag = true;
      } else
        flag = true;
    }
    printf("%s\n", flag ? "Yes" : "No");
  }
  return 0;
}
