#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T cabs(T x) {
  return x > 0 ? x : (-x);
}
template <class T>
inline T gcd(T x, T y) {
  return (y == 0) ? x : gcd(y, x % y);
}
template <class T>
inline T sgn(T x) {
  return (x > 0) - (x < 0);
}
const int maxN = 500000 + 10;
int n, m;
char str[maxN];
vector<int> adj[maxN];
int dep[maxN];
vector<int> depth[maxN];
void get_each_depth() {
  queue<pair<int, int> > q;
  dep[1] = 1;
  depth[1].push_back(1);
  q.push(make_pair(1, 1));
  while (!q.empty()) {
    pair<int, int> now = q.front();
    q.pop();
    for (int i = 0; i < (int)adj[now.first].size(); i++) {
      dep[adj[now.first][i]] = now.second + 1;
      depth[now.second + 1].push_back(adj[now.first][i]);
      q.push(make_pair(adj[now.first][i], now.second + 1));
    }
  }
}
int step;
int in[maxN], out[maxN];
void dfs(int u) {
  in[u] = step++;
  for (int i = 0; i < (int)adj[u].size(); i++) dfs(adj[u][i]);
  out[u] = step++;
}
void get_each_in_out() {
  step = 1;
  dfs(1);
}
map<pair<int, int>, int> mp;
int isOK(int a, int b) { return in[a] < in[b] && out[b] < out[a]; }
int isLeft(int a, int b) { return out[b] < in[a]; }
int isRight(int a, int b) { return out[a] < in[b]; }
int deg[26];
void run(int v, int h) {
  if (dep[v] >= h) {
    puts("Yes");
    return;
  }
  int l = 0, r = (int)depth[h].size() - 1, m;
  int ans1 = -1;
  while (l <= r) {
    m = (l + r) >> 1;
    if (isOK(v, depth[h][m]))
      ans1 = m, r = m - 1;
    else if (isLeft(v, depth[h][m]))
      l = m + 1;
    else
      r = m - 1;
  }
  if (ans1 == -1) {
    puts("Yes");
    return;
  }
  int ans2 = -1;
  l = 0, r = (int)depth[h].size() - 1;
  while (l <= r) {
    m = (l + r) >> 1;
    if (isOK(v, depth[h][m]))
      ans2 = m, l = m + 1;
    else if (isLeft(v, depth[h][m]))
      l = m + 1;
    else
      r = m - 1;
  }
  if (ans2 == -1) {
    puts("Yes");
    return;
  }
  memset(deg, 0, sizeof(deg));
  for (int i = ans1; i <= ans2; i++) deg[str[depth[h][i] - 1] - 'a']++;
  int x = 0;
  for (int i = 0; i < 26; i++) x += deg[i] & 1;
  if (x <= 1) {
    puts("Yes");
    mp[make_pair(v, h)] = 1;
  } else {
    puts("No");
    mp[make_pair(v, h)] = -1;
  }
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 2, j; i <= n; i++) {
    scanf("%d", &j);
    adj[j].push_back(i);
  }
  scanf("%s", str);
  get_each_depth();
  get_each_in_out();
  int v, h;
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &v, &h);
    int x = mp[make_pair(v, h)];
    if (x == 1)
      puts("Yes");
    else if (x == -1)
      puts("No");
    else
      run(v, h);
  }
  return 0;
}
