#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  char ch = getchar();
  bool flag = false;
  x = 0;
  while (!isdigit(ch)) flag |= (ch == '-'), ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  if (flag) x = -x;
}
int dx[4] = {-1, -1, 1, 1};
int dy[4] = {0, -1, 0, 1};
const double eps = 10e-5;
const int Mod = 1e9 + 7;
const int N = 5e5 + 1;
struct Edge {
  int to, next;
} e[N];
int n, m, head[N], tot;
int sz[N], son[N], dep[N];
int cnt[N][26];
char s[N];
vector<pair<int, int> > qt[N];
bool ans[N];
void add(int x, int y) {
  e[++tot].to = y, e[tot].next = head[x], head[x] = tot;
}
void dfs1(int x, int depth) {
  dep[x] = depth;
  sz[x] = 1;
  for (int i = head[x]; ~i; i = e[i].next) {
    int y = e[i].to;
    dfs1(y, depth + 1);
    sz[x] += sz[y];
    if (sz[y] > sz[son[x]]) son[x] = y;
  }
}
int Bigson;
void update(int x, int val) {
  cnt[dep[x]][s[x] - 'a'] += val;
  for (int i = head[x]; ~i; i = e[i].next) {
    int &y = e[i].to;
    if (y == Bigson) continue;
    update(y, val);
  }
}
bool check(int sum[]) {
  int res = 0;
  for (int i = 0; i < 26; i++) {
    if (sum[i] & 1) ++res;
    if (res > 1) break;
  }
  return res <= 1;
}
void dfs2(int x, int op) {
  for (int i = head[x]; ~i; i = e[i].next) {
    int &y = e[i].to;
    if (y == son[x]) continue;
    dfs2(y, 0);
  }
  if (son[x]) dfs2(son[x], 1), Bigson = son[x];
  update(x, 1);
  Bigson = 0;
  for (auto it : qt[x]) ans[it.second] = check(cnt[it.first]);
  if (!op) update(x, -1);
}
int main() {
  scanf("%d%d", &n, &m);
  memset(head, -1, sizeof(head));
  for (int i = 2; i <= n; i++) {
    int u;
    scanf("%d", &u);
    add(u, i);
  }
  scanf("%s", s + 1);
  dfs1(1, 1);
  for (int i = 1; i <= m; i++) {
    int u, d;
    scanf("%d%d", &u, &d);
    qt[u].push_back(make_pair(d, i));
  }
  dfs2(1, 0);
  for (int i = 1; i <= m; i++) {
    puts(ans[i] ? "Yes" : "No");
  }
  return 0;
}
