#include <bits/stdc++.h>
using namespace std;
int n, m;
int d[500100], ans[500100];
vector<pair<int, int> > h[500100];
vector<int> v[500100];
char s[500100];
int dp[500100][27];
int save[500100][27];
void dfs(int x, int hi) {
  for (int i = 0; i < h[x].size(); i++) {
    for (int j = 0; j < 26; j++) {
      save[h[x][i].second][j] = dp[h[x][i].first][j];
    }
  }
  for (int i = 0; i < v[x].size(); i++) {
    dfs(v[x][i], hi + 1);
  }
  dp[hi][s[x] - 'a']++;
  for (int i = 0; i < h[x].size(); i++) {
    int par = 0, impar = 0;
    for (int j = 0; j < 26; j++) {
      if ((dp[h[x][i].first][j] - save[h[x][i].second][j]) % 2 == 0)
        par++;
      else
        impar++;
    }
    if (impar <= 1) ans[h[x][i].second] = 1;
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 2; i <= n; i++) {
    scanf("%d", &d[i]);
    v[d[i]].push_back(i);
  }
  scanf("%s", s + 1);
  int vi, hi;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &vi, &hi);
    h[vi].push_back(make_pair(hi, i));
  }
  dfs(1, 1);
  for (int i = 1; i <= m; i++) {
    if (ans[i])
      printf("Yes\n");
    else
      printf("No\n");
  }
}
