#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
const int INF = 1e18;
int n, cnt[maxn][26], sub[maxn], q, h[maxn];
char c[maxn];
vector<int> g[maxn];
vector<pair<int, int> > qu[maxn], vec[maxn];
string ans[maxn];
void dfs(int v, int p) {
  sub[v] = 1;
  for (auto u : g[v]) {
    if (u != p) {
      h[u] = h[v] + 1;
      dfs(u, v);
      sub[v] += sub[u];
    }
  }
}
void gooni(int v, int p, bool keep) {
  int mx = -1, bigch = -1;
  for (auto u : g[v])
    if (u != p)
      if (sub[u] > mx) mx = sub[u], bigch = u;
  for (auto u : g[v])
    if (u != p && u != bigch) gooni(u, v, 0);
  if (bigch != -1) {
    gooni(bigch, v, 1);
    swap(vec[v], vec[bigch]);
  }
  for (auto u : g[v]) {
    if (u != p && u != bigch) {
      for (auto x : vec[u]) {
        vec[v].push_back(x);
        cnt[x.second][c[x.first] - 'a']++;
      }
    }
  }
  vec[v].push_back({v, h[v]});
  cnt[h[v]][c[v] - 'a']++;
  for (auto qq : qu[v]) {
    int hh = qq.first, ind = qq.second, odd = 0;
    string anss = "Yes";
    for (int i = 0; i < 26; i++)
      if (cnt[hh][i] & 1) odd++;
    if (odd > 1) anss = "No";
    ans[ind] = anss;
  }
  if (keep == 0) {
    for (auto x : vec[v]) cnt[x.second][c[x.first] - 'a']--;
  }
}
int main() {
  std::ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  h[1] = 1;
  cin >> n >> q;
  for (int i = 2; i <= n; i++) {
    int v;
    cin >> v;
    g[v].push_back(i);
    g[i].push_back(v);
  }
  string s1;
  cin >> s1;
  for (int i = 0; i < n; i++) c[i + 1] = s1[i];
  for (int i = 1; i <= q; i++) {
    int v, h;
    cin >> v >> h;
    qu[v].push_back({h, i});
  }
  dfs(1, 0);
  gooni(1, 0, 1);
  for (int i = 1; i <= q; i++) cout << ans[i] << "\n";
  return 0;
}
