#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long int llINF = (long long)(1e18) + 100;
const int MAXN = 5e5 + 10;
int n, m;
string s;
bool ans[MAXN];
int sz[MAXN], dpt[MAXN], in[MAXN], out[MAXN], rt[MAXN], clk;
int cnt[MAXN][30], pal[MAXN];
vector<int> adj[MAXN];
vector<pair<int, int> > qry[MAXN];
void dfs_sz(int v, int p = -1) {
  sz[v] = 1;
  in[v] = clk;
  rt[clk++] = v;
  for (auto &x : adj[v]) {
    if (x != p) {
      dpt[x] = dpt[v] + 1;
      dfs_sz(x, v);
      sz[v] += sz[x];
      if (sz[x] > sz[adj[v][0]] or adj[v][0] == p) swap(x, adj[v][0]);
    }
  }
  out[v] = clk - 1;
}
void dfs(int v, int p = -1, bool keep = 0) {
  int bc = adj[v].size() > 1 ? adj[v][0] : -1;
  for (int u : adj[v])
    if (u != p and u != bc) dfs(u, v);
  if (bc != -1) dfs(bc, v, 1);
  int k;
  for (int u : adj[v])
    if (u != p and u != bc) {
      for (int x = in[u]; x <= out[u]; x++) {
        k = rt[x];
        pal[dpt[k]] -= cnt[dpt[k]][s[k] - 'a'];
        cnt[dpt[k]][s[k] - 'a'] ^= 1;
        pal[dpt[k]] += cnt[dpt[k]][s[k] - 'a'];
      }
    }
  k = v;
  pal[dpt[k]] -= cnt[dpt[k]][s[k] - 'a'];
  cnt[dpt[k]][s[k] - 'a'] ^= 1;
  pal[dpt[k]] += cnt[dpt[k]][s[k] - 'a'];
  for (auto x : qry[v]) ans[x.second] = pal[x.first] <= 1;
  if (!keep)
    for (int x = in[v]; x <= out[v]; x++) {
      k = rt[x];
      pal[dpt[k]] = 0;
      cnt[dpt[k]][s[k] - 'a'] = 0;
    }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  int x, y;
  for (int i = 2; i <= n; i++) {
    cin >> x;
    adj[i].push_back(x);
    adj[x].push_back(i);
  }
  cin >> s;
  s = '#' + s;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    qry[x].push_back({y, i});
  }
  dpt[1] = 1;
  dfs_sz(1);
  dfs(1);
  for (int i = 0; i < m; i++)
    if (ans[i])
      cout << "Yes" << '\n';
    else
      cout << "No" << '\n';
}
