#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 5;
const int Mod = 1000000007;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const double e = exp(1);
const double PI = acos(-1);
const double ERR = 1e-10;
vector<int> G[maxn];
int sz[maxn], ans[maxn];
bool big[maxn];
char str[maxn];
int cnt[maxn][30], dep[maxn];
struct Q {
  int id, h;
  Q() {}
  Q(int id_, int h_) {
    id = id_;
    h = h_;
  }
};
vector<Q> query[maxn];
void dfs0(int rt) {
  sz[rt] = 1;
  for (int i = 0; i < G[rt].size(); i++) {
    int to = G[rt][i];
    dep[to] = dep[rt] + 1;
    dfs0(to);
    sz[rt] += sz[to];
  }
}
void add(int rt, int x) {
  cnt[dep[rt]][str[rt] - 'a'] += x;
  for (int i = 0; i < G[rt].size(); i++) {
    if (big[G[rt][i]]) continue;
    add(G[rt][i], x);
  }
}
void dfs(int rt, int keep) {
  int mx = -1, bigson = -1;
  for (int i = 0; i < G[rt].size(); i++) {
    int to = G[rt][i];
    if (sz[to] > mx) {
      mx = sz[to];
      bigson = to;
    }
  }
  for (int i = 0; i < G[rt].size(); i++) {
    int to = G[rt][i];
    if (to != bigson) dfs(to, 0);
  }
  if (bigson != -1) {
    dfs(bigson, 1);
    big[bigson] = 1;
  }
  add(rt, 1);
  for (int i = 0; i < query[rt].size(); i++) {
    Q tmp = query[rt][i];
    int s = 0;
    for (int i = 0; i < 26; i++) s = s + (cnt[tmp.h][i] % 2 == 1);
    ans[tmp.id] = (s <= 1);
  }
  if (bigson != -1) big[bigson] = 0;
  if (keep == 0) add(rt, -1);
}
int main() {
  int n, m, x, u, v;
  scanf("%d%d", &n, &m);
  for (int i = 2; i <= n; i++) {
    scanf("%d", &x);
    G[x].push_back(i);
  }
  scanf("%s", str + 1);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &u, &v);
    query[u].push_back(Q(i, v));
  }
  dep[1] = 1;
  dfs0(1);
  dfs(1, 0);
  for (int i = 1; i <= m; i++) {
    if (ans[i] == 1)
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
