#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void rd(T &x) {
  char ch;
  x = 0;
  bool fl = false;
  while (!isdigit(ch = getchar())) (ch == '-') && (fl = true);
  for (x = (ch ^ '0'); isdigit(ch = getchar()); x = x * 10 + (ch ^ '0'))
    ;
  (fl == true) && (x = -x);
}
template <class T>
inline void ot(T x) {
  x / 10 ? ot(x / 10) : putchar(x % 10 + '0');
}
template <class T>
inline void prt(T a[], int st, int nd) {
  for (register int i = st; i <= nd; ++i) printf("%lld ", a[i]);
  putchar('\n');
}
namespace Miracle {
const int N = 500000 + 5;
int n, m;
struct node {
  int nxt, to;
} e[2 * N];
int hd[N], cnt;
int alp[N];
char s[N];
void add(int x, int y) {
  e[++cnt].nxt = hd[x];
  e[cnt].to = y;
  hd[x] = cnt;
}
int son[N];
int ci[N];
int has[N];
int sz[N];
vector<pair<int, int> > mem[N];
int dep[N];
int ans[N];
int Son;
void dfs1(int x, int d) {
  dep[x] = d;
  sz[x] = 1;
  for (register int i = hd[x]; i; i = e[i].nxt) {
    int y = e[i].to;
    dfs1(y, d + 1);
    sz[x] += sz[y];
    if (sz[y] > sz[son[x]]) son[x] = y;
  }
}
void upda(int x, int val) {
  ci[dep[x]] ^= (1 << alp[x]);
  has[dep[x]] += val;
  for (register int i = hd[x]; i; i = e[i].nxt) {
    int y = e[i].to;
    if (y == Son) continue;
    upda(y, val);
  }
}
void sol(int x, int op) {
  for (register int i = hd[x]; i; i = e[i].nxt) {
    int y = e[i].to;
    if (y != son[x]) sol(y, 0);
  }
  if (son[x]) sol(son[x], 1), Son = son[x];
  upda(x, 1);
  for (register int i = 0; i < (int)mem[x].size(); ++i) {
    int d = mem[x][i].second;
    if (__builtin_popcount(ci[d]) <= 1) ans[mem[x][i].first] = 1;
  }
  Son = 0;
  if (op == 0) upda(x, -1);
}
int main() {
  rd(n);
  rd(m);
  int x, y;
  for (register int i = 2; i <= n; ++i) {
    rd(y);
    add(y, i);
  }
  scanf("%s", s + 1);
  for (register int i = 1; i <= n; ++i) alp[i] = s[i] - 'a';
  dfs1(1, 1);
  for (register int i = 1; i <= m; ++i) {
    rd(x);
    rd(y);
    mem[x].push_back(make_pair(i, y));
  }
  sol(1, 1);
  for (register int i = 1; i <= m; ++i) {
    if (ans[i] == 1)
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
}  // namespace Miracle
signed main() {
  Miracle::main();
  return 0;
}
