#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
void io() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(15);
}
double tick() {
  static clock_t oldt;
  clock_t newt = clock();
  double diff = 1.0 * (newt - oldt) / CLOCKS_PER_SEC;
  oldt = newt;
  return diff;
}
long long mulmod(long long a, long long b, long long m) {
  long long q = (long long)(((long double)a * (long double)b) / (long double)m);
  long long r = a * b - q * m;
  if (r > m) r %= m;
  if (r < 0) r += m;
  return r;
}
template <typename T>
T mod(T a, T b) {
  while (a < 0) a += b;
  return a % b;
}
template <typename T>
T power(T e, T n, T m) {
  T x = 1, p = e;
  while (n) {
    if (n & 1) x = mod(x * p, m);
    p = mod(p * p, m);
    n >>= 1;
  }
  return x;
}
template <typename T>
T power(T e, T n) {
  T x = 1, p = e;
  while (n) {
    if (n & 1) x = x * p;
    p = p * p;
    n >>= 1;
  }
  return x;
}
template <typename T>
T InverseEuler(T a, T m) {
  return (a == 1 ? 1 : power(a, m - 2, m));
}
template <typename T>
inline T gcd(T a, T b) {
  T c;
  while (b) {
    c = b;
    b = a % b;
    a = c;
  }
  return a;
}
template <typename T>
T lcm(T a, T b) {
  return (a * (b / gcd(a, b)));
}
long long exEuclid(long long a, long long b, long long &x, long long &y) {
  if (a == 0) {
    x = 0;
    y = 1;
    return b;
  }
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long x1, y1;
  long long g = exEuclid(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return g;
}
vector<pair<int, int> > vh[500005];
int p2(int x) { return (1 << x); }
int tmr;
int tin[500005];
int tout[500005];
int par[500005];
vector<int> g[500005];
char s[500005];
int ht[500005];
void dfs(int u = 1, int h = 1) {
  tin[u] = ++tmr;
  int nx = (vh[h].back().second) ^ p2(s[u] - 'a');
  vh[h].push_back(make_pair(tin[u], nx));
  for (int i = 0; i < g[u].size(); i++) {
    dfs(g[u][i], h + 1);
  }
  tout[u] = ++tmr;
}
int main(int argc, char *argv[]) {
  int n, m;
  int x = 1 << 25;
  scanf("%d%d", &n, &m);
  int p;
  for (int i = 0; i <= n; i++) {
    vh[i].push_back(make_pair(0, 0));
  }
  for (int i = 2; i <= n; i++) {
    scanf("%d", &p);
    g[p].push_back(i);
  }
  scanf("%s", s + 1);
  dfs();
  int u, h;
  while (m--) {
    scanf("%d%d", &u, &h);
    int lo = lower_bound(vh[h].begin(), vh[h].end(), make_pair(tin[u], -1)) -
             vh[h].begin() - 1;
    int hi = lower_bound(vh[h].begin(), vh[h].end(), make_pair(tout[u], -1)) -
             vh[h].begin() - 1;
    int chk = vh[h][lo].second ^ vh[h][hi].second;
    if (!chk || (((chk) & (chk - 1)) == 0)) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}
