#include <bits/stdc++.h>
using namespace std;
int N, M;
const int SIZE = 500005;
int l[SIZE], r[SIZE];
vector<int> pos[SIZE], num[SIZE], g[SIZE];
char s[SIZE];
int no = 1;
void dfs(int u, int d) {
  l[u] = no++;
  pos[d].push_back(l[u]);
  num[d].push_back(num[d].back() ^ (1 << (s[u] - 'a')));
  for (int i = 0; i < g[u].size(); i++) {
    dfs(g[u][i], d + 1);
  }
  r[u] = no;
}
int lowbit(int k) { return k & (-k); }
int popCount(int n) {
  int cnt = 0;
  while (n) {
    cnt++;
    n -= lowbit(n);
  }
  return cnt;
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 2; i <= N; i++) {
    int n;
    scanf("%d", &n);
    g[n].push_back(i);
  }
  scanf("%s", s + 1);
  for (int i = 1; i <= N; i++) {
    num[i].push_back(0);
    pos[i].push_back(0);
  }
  dfs(1, 1);
  while (M--) {
    int x, d;
    scanf("%d%d", &x, &d);
    int st, en;
    st = lower_bound(pos[d].begin(), pos[d].end(), l[x]) - pos[d].begin() - 1;
    en = lower_bound(pos[d].begin(), pos[d].end(), r[x]) - pos[d].begin() - 1;
    if (popCount(num[d][en] ^ num[d][st]) <= 1)
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
