#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 50;
int n, m;
vector<int> g[N];
vector<pair<int, int>> q[N];
char nv[N];
int sts[N], depth[N];
int ans[N];
int dfspre(int v, int d = 0) {
  auto &ans = sts[v];
  depth[v] = ++d;
  ans = 1;
  for (auto u : g[v]) {
    ans += dfspre(u, d);
  }
  return ans;
}
int at_depth[N][27];
int oc[N];
vector<pair<char, int>> *vec[N];
inline void add(pair<char, int> &c) {
  if ((++at_depth[c.second][c.first - 'a']) & 1) {
    oc[c.second]++;
  } else {
    oc[c.second]--;
  }
}
inline void rem(pair<char, int> &c) {
  if ((--at_depth[c.second][c.first - 'a']) & 1) {
    oc[c.second]++;
  } else {
    oc[c.second]--;
  }
}
void dfs(int v, int p, bool keep) {
  int mxc, bc;
  mxc = bc = -1;
  for (auto u : g[v]) {
    if (u != p) {
      if (sts[u] > mxc) {
        bc = u, mxc = sts[u];
      }
    }
  }
  for (auto u : g[v]) {
    if (u == p || u == bc) {
      continue;
    }
    dfs(u, v, 0);
  }
  if (bc == -1) {
    vec[v] = new vector<pair<char, int>>;
  } else {
    dfs(bc, v, 1);
    vec[v] = vec[bc];
  }
  auto temp = make_pair(nv[v], depth[v]);
  vec[v]->push_back(temp);
  add(temp);
  for (auto u : g[v]) {
    if (u != p && u != bc) {
      for (auto z : *vec[u]) {
        add(z);
        vec[v]->push_back(z);
      }
      delete vec[u];
    }
  }
  for (auto u : q[v]) {
    if (oc[u.first] < 2) {
      ans[u.second] = 1;
    }
  }
  if (keep == 0) {
    for (auto u : *vec[v]) {
      rem(u);
    }
  }
}
int main(int argc, const char **argv) {
  if (argc >= 2) {
    freopen(argv[1], "r", stdin);
  }
  cin >> n >> m;
  for (int i = 2, x; i <= n; i++) {
    scanf("%d", &x);
    g[x].push_back(i);
  }
  scanf("%s", 1 + nv);
  for (int i = 0, x, y; i < m; i++) {
    scanf("%d %d", &x, &y);
    q[x].push_back({y, i});
  }
  dfspre(1);
  dfs(1, -1, 1);
  for (int i = 0; i < m; i++) {
    printf("%s\n", ans[i] ? "Yes" : "No");
  }
}
