#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 10;
string s;
struct que {
  int dep, id;
};
int n, ind, dep[N], siz[N], son[N];
int cc[N], dfn[N], val[N];
vector<int> g[N];
vector<que> q[N];
bool ans[N], m[N][30];
void read(int &x) {
  int f = 1;
  x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= f;
}
void dfs(int x, int f) {
  int mxson = -1;
  dfn[x] = ++ind, cc[ind] = x;
  val[x] = s[x - 1] - 'a' + 1;
  dep[x] = dep[f] + 1, siz[x] = 1;
  for (int i = 0; i < g[x].size(); i++) {
    int y = g[x][i];
    dfs(y, x), siz[x] += siz[y];
    if (siz[y] > mxson) son[x] = y, mxson = siz[y];
  }
}
void update(int x) {
  for (int i = dfn[x], t; i < dfn[x] + siz[x]; i++)
    t = cc[i], m[dep[t]][val[t]] ^= 1;
}
void dfs2(int x, int tp) {
  for (int i = 0; i < g[x].size(); i++) {
    int y = g[x][i];
    if (y == son[x]) continue;
    dfs2(y, 0);
  }
  if (son[x]) dfs2(son[x], 1);
  for (int i = 0; i < g[x].size(); i++) {
    int y = g[x][i];
    if (y == son[x]) continue;
    update(y);
  }
  m[dep[x]][val[x]] ^= 1;
  for (int i = 0; i < q[x].size(); i++) {
    que t = q[x][i];
    int ok = 0;
    for (int j = 1; j <= 26; j++) ok += (m[t.dep][j] & 1);
    ans[t.id] = (ok <= 1);
  }
  if (!tp) update(x);
}
int main() {
  int Q;
  read(n), read(Q);
  for (int i = 2, x; i <= n; i++) read(x), g[x].push_back(i);
  cin >> s;
  dfs(1, 0);
  for (int i = 1, x, y; i <= Q; i++)
    read(x), read(y), q[x].push_back((que){y, i});
  dfs2(1, 1);
  for (int i = 1; i <= Q; i++)
    if (ans[i])
      puts("Yes");
    else
      puts("No");
  return 0;
}
