#include <bits/stdc++.h>
using namespace std;
double PI = acos(-1);
int const N = 5e5 + 10, oo = 1e9;
int mod = oo + 7;
long long const OO = 1e18;
string s;
int n, m, sz[N], dep[N], res[N];
bool gen[N][26];
vector<int> adj[N], in[N];
vector<pair<int, int> > q[N];
void dfs1(int u, int p) {
  sz[u]++;
  for (auto v : adj[u]) {
    if (v == p) continue;
    dep[v] = dep[u] + 1;
    dfs1(v, u);
    sz[u] += sz[v];
  }
}
void dfs2(int u, int p, bool y) {
  int mx = -1, wh = -1;
  for (auto v : adj[u]) {
    if (v == p) continue;
    if (sz[v] > mx) mx = sz[v], wh = v;
  }
  for (auto v : adj[u]) {
    if (v == p || v == wh) continue;
    dfs2(v, u, 0);
  }
  if (wh != -1) {
    dfs2(wh, u, 1);
    in[u].swap(in[wh]);
  }
  in[u].push_back(u);
  gen[dep[u]][s[u] - 'a'] ^= 1;
  for (auto v : adj[u]) {
    if (v == p || v == wh) continue;
    for (auto e : in[v]) {
      in[u].push_back(e);
      gen[dep[e]][s[e] - 'a'] ^= 1;
    }
  }
  for (auto a : q[u]) {
    int od = 0;
    for (int i = 0; i < 26; i++) {
      if (gen[a.first][i]) {
        od++;
        if (od > 1) break;
      }
    }
    res[a.second] = (od <= 1);
  }
  if (y) return;
  for (auto v : in[u]) gen[dep[v]][s[v] - 'a'] ^= 1;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i < n; i++) {
    int a;
    cin >> a;
    a--;
    adj[a].push_back(i);
    adj[i].push_back(a);
  }
  cin >> s;
  dep[0] = 1;
  dfs1(0, -1);
  for (int i = 0; i < m; i++) {
    int v, h;
    cin >> v >> h;
    v--;
    if (h < dep[v]) {
      res[i] = 1;
      continue;
    }
    q[v].push_back({h, i});
  }
  dfs2(0, -1, 0);
  for (int i = 0; i < m; i++)
    if (res[i])
      cout << "Yes\n";
    else
      cout << "No\n";
  return 0;
}
