#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T bigMod(T p, T e, T M) {
  long long ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % M;
    p = (p * p) % M;
  }
  return (T)ret;
}
template <class T>
inline T modInverse(T a, T M) {
  return bigMod(a, M - 2, M);
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  a = abs(a);
  b = abs(b);
  return (a / gcd(a, b)) * b;
}
template <class T>
inline string int2String(T a) {
  ostringstream str;
  str << a;
  return str.str();
}
const int dr[] = {0, 1, 0, -1, -1, 1, 1, -1, -2, -2, 2, 2, -1, -1, 1, 1};
const int dc[] = {1, 0, -1, 0, 1, 1, -1, -1, -1, 1, -1, 1, -2, 2, -2, 2};
void fileIO() {}
const int maxn = 5e5 + 8;
vector<int> g[maxn];
char ch[maxn];
int sz[maxn], bigChild[maxn], lev[maxn];
void getSize(int v, int p, int lv) {
  sz[v] = 1, bigChild[v] = -1, lev[v] = lv;
  int mx = -1;
  for (auto u : g[v])
    if (u != p) {
      getSize(u, v, lv + 1);
      sz[v] += sz[u];
      if (mx < sz[u]) mx = sz[u], bigChild[v] = u;
    }
}
vector<pair<int, int> > qry[maxn];
bool big[maxn], ans[maxn];
int cnt[26][maxn];
void add(int v, int p, int x) {
  cnt[ch[v] - 'a'][lev[v]] += x;
  for (auto u : g[v])
    if (u != p && !big[u]) add(u, v, x);
}
void dfs(int v, int p, int keep) {
  for (auto u : g[v])
    if (u != p && u != bigChild[v]) dfs(u, v, 0);
  if (bigChild[v] != -1) dfs(bigChild[v], v, 1), big[bigChild[v]] = 1;
  add(v, p, 1);
  for (auto d : qry[v]) {
    int odd = 0, even = 0;
    for (int i = int(0); i < int(26); i++) cnt[i][d.first] & 1 ? odd++ : even++;
    ans[d.second] = (odd <= 1);
  }
  if (bigChild[v] != -1) big[bigChild[v]] = 0;
  if (keep == 0) add(v, p, -1);
}
int main() {
  int n, q, x;
  scanf("%d%d", &n, &q);
  for (int i = int(1); i < int(n); i++) scanf("%d", &x), g[--x].push_back(i);
  scanf("%s", ch);
  int y;
  for (int i = int(0); i < int(q); i++)
    scanf("%d%d", &x, &y), qry[--x].push_back(make_pair(--y, i));
  getSize(0, -1, 0);
  dfs(0, -1, 1);
  for (int i = int(0); i < int(q); i++) puts(ans[i] ? "Yes" : "No");
  return 0;
}
