#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 100;
int col[N];
vector<int> G[N];
int sz[N], son[N], dep[N];
void dfs(int x, int fa) {
  sz[x] = 1;
  for (int v : G[x]) {
    if (v == fa) continue;
    dep[v] = dep[x] + 1;
    dfs(v, x);
    sz[x] += sz[v];
    if (sz[son[x]] < sz[v]) son[x] = v;
  }
}
int Son;
int cnt[N][30], vis[N];
int ans[N];
vector<pair<int, int>> Q[N];
void add(int x, int fa, int val) {
  cnt[dep[x]][col[x]] += val;
  for (int v : G[x]) {
    if (v == fa || Son == v) continue;
    add(v, x, val);
  }
}
void DFS(int x, int fa, int key) {
  for (int v : G[x]) {
    if (v == fa || v == son[x]) continue;
    DFS(v, x, 0);
  }
  if (son[x]) DFS(son[x], x, 1), Son = son[x];
  add(x, fa, 1);
  Son = 0;
  for (auto p : Q[x]) {
    int d = p.first, id = p.second;
    int oddsum = 0;
    for (int j = 1; j <= 26; j++) {
      if (cnt[d][j] & 1) oddsum++;
    }
    if (oddsum <= 1)
      ans[id] = 1;
    else
      ans[id] = 0;
  }
  if (key == 0) add(x, fa, -1);
}
int main() {
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (int i = 2; i <= n; i++) {
    int x;
    cin >> x;
    G[x].push_back(i);
    G[i].push_back(x);
  }
  string s;
  cin >> s;
  for (int i = 1; i <= n; i++) col[i] = s[i - 1] - 'a' + 1;
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    Q[x].push_back({y, i});
  }
  dep[1] = 1;
  dfs(1, 0);
  DFS(1, 0, 1);
  for (int i = 1; i <= m; i++) {
    if (ans[i] == 0)
      cout << "No\n";
    else
      cout << "Yes\n";
  }
  return 0;
}
