#include <bits/stdc++.h>
using namespace std;
vector<int> v[500005], in(500005, 0), out(500005, 0),
    depth(500005, 0), dep[500005];
map<pair<long long int, long long int>, long long int> mp;
void dfs() {
  queue<pair<int, int>> q;
  depth[1] = 1;
  dep[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)v[now.first].size(); i++) {
      depth[v[now.first][i]] = now.second + 1;
      dep[now.second + 1].push_back(v[now.first][i]);
      q.push(make_pair(v[now.first][i], now.second + 1));
    }
  }
}
int t = 0;
string str;
void get_in_out(int start) {
  in[start] = t++;
  for (int i = 0; i < v[start].size(); i++) get_in_out(v[start][i]);
  out[start] = t++;
}
int isok(int a, int b) { return (in[b] <= in[a] && out[b] >= out[a]); }
int isleft(int a, int b) { return out[a] < in[b]; }
int run(int ver, int h) {
  if (depth[ver] >= h) {
    mp[{ver, h}] = 1;
    printf("Yes\n");
    return 0;
  }
  int ans1 = -1, ans2 = -1;
  int l = 0, r = dep[h].size() - 1;
  while (l <= r) {
    int m = (l + r) >> 1;
    if (isok(dep[h][m], ver)) {
      ans1 = m, r = m - 1;
    } else if (isleft(dep[h][m], ver)) {
      l = m + 1;
    } else {
      r = m - 1;
    }
  }
  if (ans1 == -1) {
    mp[{ver, h}] = 1;
    printf("Yes\n");
    return 0;
  }
  l = 0, r = dep[h].size() - 1;
  while (l <= r) {
    int m = (l + r + 1) >> 1;
    if (isok(dep[h][m], ver)) {
      ans2 = m, l = m + 1;
    } else if (isleft(dep[h][m], ver)) {
      l = m + 1;
    } else {
      r = m - 1;
    }
  }
  if (ans2 == -1) {
    puts("Yes");
    return 0;
  }
  vector<int> alpha(26, 0);
  for (int i = ans1; i <= ans2; i++) {
    alpha[str[dep[h][i] - 1] - 'a']++;
  }
  int x = 0;
  for (int i = 0; i < 26; i++) {
    if (alpha[i] & 1) {
      x++;
    }
  }
  if (x <= 1) {
    mp[{ver, h}] = 1;
    printf("Yes\n");
    return 0;
  } else {
    printf("No\n");
    mp[{ver, h}] = -1;
    return 0;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  for (long long int i = 2; i <= n; i++) {
    int a;
    cin >> a;
    v[a].push_back(i);
  }
  cin >> str;
  dfs();
  get_in_out(1);
  while (m--) {
    int ver, h;
    cin >> ver >> h;
    int x = mp[{ver, h}];
    if (x == 1) {
      printf("Yes\n");
    } else if (x == -1) {
      printf("No\n");
    } else
      run(ver, h);
  }
  return 0;
}
