#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 100;
vector<int> g[maxn];
int siz[maxn], son[maxn], dep[maxn];
vector<pair<int, int> > p[maxn];
void dfs(int x, int f) {
  dep[x] = dep[f] + 1;
  siz[x] = 1;
  int maxson = -1;
  for (int v : g[x]) {
    if (v == f) continue;
    dfs(v, x);
    siz[x] += siz[v];
    if (siz[v] > maxson) son[x] = v, maxson = siz[v];
  }
}
int flag;
int cnt[maxn][30], ans[maxn];
int col[maxn];
char s[maxn];
void Count(int x, int f, int val) {
  cnt[dep[x]][col[x]] += val;
  for (int v : g[x]) {
    if (v == f || v == flag) continue;
    Count(v, x, val);
  }
}
void DFS(int x, int f, bool keep) {
  for (int v : g[x]) {
    if (v == f || v == son[x]) continue;
    DFS(v, x, 0);
  }
  if (son[x]) {
    DFS(son[x], x, 1);
    flag = son[x];
  }
  Count(x, f, 1);
  flag = 0;
  for (pair<int, int> it : p[x]) {
    int f = 0;
    for (int i = 1; i <= 26; i++) {
      if (cnt[it.first][i] & 1) f++;
    }
    ans[it.second] = f > 1 ? 0 : 1;
  }
  if (!keep) {
    Count(x, f, -1);
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 2; i <= n; i++) {
    int u;
    scanf("%d", &u);
    g[u].push_back(i);
    g[i].push_back(u);
  }
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++) {
    int x = s[i] - 'a' + 1;
    col[i] = x;
  }
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    p[x].push_back(make_pair(y, i));
  }
  dfs(1, 0);
  DFS(1, 0, 1);
  for (int i = 1; i <= m; i++)
    if (ans[i])
      puts("Yes");
    else
      puts("No");
  return 0;
}
