#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int maxn = 5e5 + 5;
vector<int> G[maxn];
int n, m, a[maxn];
int deep[maxn], sz[maxn], son[maxn];
void dfs(int u, int pre) {
  deep[u] = deep[pre] + 1;
  son[u] = 0;
  sz[u] = 1;
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    if (v != pre) {
      dfs(v, u);
      sz[u] += sz[v];
      if (sz[v] > sz[son[u]]) son[u] = v;
    }
  }
}
int Son = 0, cnt[maxn][30];
void calc(int u, int pre, int val) {
  cnt[deep[u]][a[u]] += val;
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    if (v == pre || v == Son) continue;
    calc(v, u, val);
  }
}
vector<pair<int, int> > Q[maxn];
bool ans[maxn];
void dsu(int u, int pre, int del) {
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i];
    if (v == pre || v == son[u]) continue;
    dsu(v, u, 1);
  }
  if (son[u]) dsu(son[u], u, 0), Son = son[u];
  calc(u, pre, 1);
  Son = 0;
  for (int i = 0; i < Q[u].size(); i++) {
    int tmp = 0;
    for (int j = 0; j <= 28; j++) {
      if (cnt[Q[u][i].first][j] & 1) tmp++;
    }
    if (tmp <= 1)
      ans[Q[u][i].second] = true;
    else
      ans[Q[u][i].second] = false;
  }
  if (del) calc(u, pre, -1);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 2; i <= n; i++) {
    int u;
    cin >> u;
    G[u].push_back(i);
  }
  string s;
  cin >> s;
  for (int i = 0; i < s.length(); i++) {
    a[i + 1] = s[i] - 'a';
  }
  for (int i = 1; i <= m; i++) {
    int v, h;
    cin >> v >> h;
    Q[v].push_back(make_pair(h, i));
  }
  dfs(1, 0);
  dsu(1, 0, 1);
  for (int i = 1; i <= m; i++) {
    if (ans[i])
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
