#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
int n, m, a[N], sz[N], dpth[N], big[N], odd[N];
bool l[N][27], fans[N];
vector<vector<int>> g;
vector<vector<pair<int, int>>> q;
void pre(int u, int p) {
  if (!(p + 1))
    dpth[u] = 1;
  else
    dpth[u] = dpth[p] + 1;
  sz[u] = 1;
  for (auto v : g[u]) {
    if (v != p) {
      pre(v, u);
      sz[u] += sz[v];
    }
  }
}
void add(int u, int p, int pp) {
  l[dpth[u]][a[u]] = !l[dpth[u]][a[u]];
  if (l[dpth[u]][a[u]])
    odd[dpth[u]]++;
  else
    odd[dpth[u]]--;
  for (auto v : g[u]) {
    if (v != p && !big[v]) {
      add(v, u, pp);
    }
  }
}
void rem(int u, int p) {
  l[dpth[u]][a[u]] = !l[dpth[u]][a[u]];
  if (l[dpth[u]][a[u]])
    odd[dpth[u]]++;
  else
    odd[dpth[u]]--;
  for (auto v : g[u]) {
    if (v != p && !big[v]) {
      rem(v, u);
    }
  }
}
void dfs(int u, int p, bool b) {
  int mx = -1, bigC = -1;
  for (auto v : g[u]) {
    if (v != p && sz[v] > mx) {
      mx = sz[v];
      bigC = v;
    }
  }
  for (auto v : g[u]) {
    if (v != p && v != bigC) {
      dfs(v, u, 0);
    }
  }
  if (mx > -1) {
    dfs(bigC, u, 1), big[bigC] = 1;
  }
  add(u, p, u);
  for (auto pi : q[u]) {
    fans[pi.second] = (odd[pi.first] <= 1);
  }
  if (mx > -1) {
    big[bigC] = 0;
  }
  if (!b) {
    rem(u, p);
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n >> m;
  g.resize(n);
  q.resize(n);
  for (int i = 0; i < n - 1; i++) {
    int v;
    cin >> v;
    v--;
    g[i + 1].push_back(v);
    g[v].push_back(i + 1);
  }
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    a[i] = c - 'a';
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    q[a].push_back({b, i});
  }
  pre(0, -1);
  dfs(0, -1, 1);
  for (int i = 0; i < m; i++) {
    cout << ((fans[i] == 1) ? "Yes\n" : "No\n");
  }
}
