#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 7, mod = 1e9 + 7, inf = 1e5 + 7;
const long long linf = (long long)1e18 + 7;
const long double eps = 1e-15, pi = 3.141592;
const int dx[] = {-1, 0, 1, 0, 1, -1, -1, 1},
          dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
inline int get_int() {
  char x = getchar();
  while (!('0' <= x && x <= '9')) x = getchar();
  int res = 0;
  while ('0' <= x && x <= '9') res = res * 10 + x - '0', x = getchar();
  return res;
}
int n, m;
int second[N], cnt[N], lvl[N], sz[N], ans[N];
bool ok[N][26], big[N];
vector<int> g[N];
vector<pair<int, int> > q[N];
inline void calc(int v = 1, int p = 1) {
  lvl[v] = lvl[p] + 1, sz[v] = 1;
  for (auto i : g[v]) calc(i, v), sz[v] += sz[i];
}
inline void add(int v) {
  cnt[lvl[v]] -= ok[lvl[v]][second[v]];
  ok[lvl[v]][second[v]] ^= 1;
  cnt[lvl[v]] += ok[lvl[v]][second[v]];
  for (auto i : g[v])
    if (!big[i]) add(i);
}
inline void dfs(int v = 1, bool keep = 0) {
  int mx = -1, id = -1;
  for (auto i : g[v])
    if (sz[i] > mx) mx = sz[i], id = i;
  for (auto i : g[v])
    if (i != id) dfs(i, 0);
  if (id != -1) big[id] = 1, dfs(id, 1);
  add(v);
  for (auto i : q[v]) ans[i.second] = cnt[i.first] <= 1;
  if (id != -1) big[id] = 0;
  if (!keep) add(v);
}
int main() {
  n = get_int(), m = get_int();
  for (int i = 2; i <= n; ++i) {
    int p;
    p = get_int();
    g[p].push_back(i);
  }
  scanf("\n");
  for (int i = 1; i <= n; ++i) {
    char x;
    x = getchar();
    second[i] = x - 'a';
  }
  for (int i = 1; i <= m; ++i) {
    int v, deep;
    v = get_int(), deep = get_int();
    q[v].push_back({deep, i});
  }
  calc();
  dfs();
  for (int i = 1; i <= m; ++i) {
    if (ans[i])
      putchar('Y'), putchar('e'), putchar('s');
    else
      putchar('N'), putchar('o');
    putchar('\n');
  }
  exit(0);
}
