#include <bits/stdc++.h>
using namespace std;
const int mxn = 5e5 + 5;
int Set(int N, int pos) { return N = N | (1 << pos); }
int reset(int N, int pos) { return N = N & ~(1 << pos); }
bool check(int N, int pos) { return (bool)(N & (1 << pos)); }
vector<int> adj[mxn];
vector<pair<int, int> > lev[mxn];
int val[mxn];
int dis[mxn];
int fin[mxn];
int timer = 0;
void dfs(int u, int p, int h) {
  dis[u] = ++timer;
  lev[h].push_back(make_pair(dis[u], lev[h].back().second ^ (1 << val[u])));
  for (auto v : adj[u]) {
    if (v == p) continue;
    dfs(v, u, h + 1);
  }
  fin[u] = ++timer;
}
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  for (int i = 2; i <= n; i++) {
    int p;
    cin >> p;
    adj[i].push_back(p);
    adj[p].push_back(i);
  }
  char c;
  for (int i = 1; i <= n; i++) {
    cin >> c;
    val[i] = c - 'a';
  }
  for (int i = 1; i <= n; i++) lev[i].push_back(make_pair(0, 0));
  dfs(1, 1, 1);
  while (q--) {
    int v, h;
    scanf("%d%d", &v, &h);
    int l = lower_bound(lev[h].begin(), lev[h].end(), make_pair(dis[v], 0)) -
            lev[h].begin();
    int r = upper_bound(lev[h].begin(), lev[h].end(), make_pair(fin[v], 0)) -
            lev[h].begin() - 1;
    if (l > 0) l--;
    int p = lev[h][l].second;
    int q = lev[h][r].second;
    int cnt = __builtin_popcount(p ^ q);
    if (cnt <= 1)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
