#include <bits/stdc++.h>
using namespace std;
const int N = 500010;
vector<int> g[N];
vector<int> q[N];
int h[N], ans[N], sum[N];
char s[N];
void dfs(int u, int d) {
  for (int i = 0; i < q[u].size(); i++) {
    int id = q[u][i];
    ans[id] ^= sum[h[id]];
  }
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    dfs(v, d + 1);
  }
  sum[d] ^= (1 << (s[u] - 'a'));
  for (int i = 0; i < q[u].size(); i++) {
    int id = q[u][i];
    ans[id] ^= sum[h[id]];
  }
}
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) != EOF) {
    memset(sum, 0, sizeof(sum));
    memset(ans, 0, sizeof(ans));
    for (int i = 2; i <= n; i++) {
      int fa;
      scanf("%d", &fa);
      g[fa].push_back(i);
    }
    scanf("%s", s + 1);
    for (int i = 0; i < m; i++) {
      int H, V;
      scanf("%d%d", &V, &H);
      q[V].push_back(i);
      h[i] = H;
    }
    dfs(1, 1);
    for (int i = 0; i < m; i++)
      if (ans[i] & (ans[i] - 1))
        printf("No\n");
      else
        printf("Yes\n");
  }
  return 0;
}
