#include <bits/stdc++.h>
using namespace std;
const int maxn = 500010;
int N, M;
int dep[maxn];
char s[maxn];
vector<int> G[maxn];
vector<int> A[maxn];
vector<int> mask[maxn];
int w[maxn], fw[maxn], num[maxn];
int dfs_clock;
void dfs(int u, int fa, int depth) {
  dep[u] = depth;
  w[u] = ++dfs_clock;
  fw[dfs_clock] = u;
  A[depth].push_back(w[u]);
  mask[depth].push_back(mask[depth].back() ^ (1 << (s[u] - 'a')));
  num[u] = 1;
  int len = G[u].size();
  for (int i = 0; i < len; i++) {
    int v = G[u][i];
    if (v == fa) continue;
    dfs(v, u, depth + 1);
    num[u] += num[v];
  }
}
int cnt[30];
int main() {
  int u, v;
  scanf("%d%d", &N, &M);
  for (int i = 0; i <= N; i++) {
    G[i].clear();
    A[i].clear();
    mask[i].clear();
    num[i] = 0;
  }
  dfs_clock = 0;
  for (int i = 2; i <= N; i++) {
    scanf("%d", &u);
    G[u].push_back(i);
  }
  scanf("%s", s + 1);
  for (int i = 0; i <= N; i++) {
    A[i].push_back(0);
    mask[i].push_back(0);
  }
  dfs(1, 0, 1);
  while (M--) {
    scanf("%d%d", &u, &v);
    int l = w[u], r = w[u] + num[u] - 1;
    int ll = lower_bound(A[v].begin(), A[v].end(), l) - A[v].begin();
    if (ll >= A[v].size()) {
      printf("Yes\n");
      continue;
    }
    if (A[v][ll] < l) ll++;
    int rr = lower_bound(A[v].begin(), A[v].end(), r) - A[v].begin();
    if (A[v][rr] > r || rr == A[v].size()) rr--;
    int x = (mask[v][rr] ^ mask[v][ll - 1]);
    if (x - (x & (-x)) == 0) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}
