#include <bits/stdc++.h>
using namespace std;
long long int cn[500005], cnt[500005][26], vis[500005], sz[500005], ans[500005];
vector<long long int> v[500005];
char c[500005];
vector<pair<long long int, long long int> > ele[500005];
long long int re = 0, ma = 0, dep[500005], cc = 0;
string s;
void dfs(long long int s, long long int pa = -1) {
  sz[s] = 1;
  long long int mx = -1;
  cn[s] = -1;
  for (auto i : v[s]) {
    if (i == pa) continue;
    dep[i] = dep[s] + 1;
    dfs(i, s);
    if (sz[i] > mx) {
      mx = sz[i];
      cn[s] = i;
    }
    sz[s] += sz[i];
  }
}
void in(long long int s, long long int pa) {
  cnt[dep[s]][c[s] - 'a'] ^= 1;
  for (auto i : v[s]) {
    if (i != pa && !vis[i]) in(i, s);
  }
}
void me(long long int s, long long int flag, long long int pa = -1) {
  for (auto i : v[s]) {
    if (i != pa && i != cn[s]) me(i, 0, s);
  }
  if (cn[s] != -1) {
    vis[cn[s]] = 1;
    me(cn[s], 1, s);
  }
  in(s, pa);
  for (auto pk : ele[s]) {
    long long int cn = 0;
    for (long long int j = 0; j < 26; j++) {
      if (cnt[pk.first][j] & 1) cn += 1;
    }
    long long int cur = pk.second;
    ans[cur] = 0;
    if (cn <= 1) ans[cur] = 1;
  }
  if (cn[s] != -1) {
    vis[cn[s]] = 0;
  }
  if (flag == 0) {
    in(s, pa);
  }
}
int main() {
  long long int i, j, n, t;
  cin >> n >> t;
  for (i = 2; i <= n; i++) {
    long long int p;
    scanf("%d", &p);
    v[p].push_back(i);
  }
  for (i = 1; i <= n; i++) {
    cin >> c[i];
  }
  for (i = 1; i <= t; i++) {
    long long int p, q;
    scanf("%d %d", &p, &q);
    ele[p].push_back({q, i});
  }
  dep[1] = 1;
  dfs(1);
  me(1, 0);
  for (i = 1; i <= t; i++) {
    if (ans[i])
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
