#include <bits/stdc++.h>
using namespace std;
const long long N = 500001;
long long t = 0;
string s;
long long in[N], out[N];
vector<long long> child[N];
vector<pair<long long, long long> > dp[N];
void dfs(long long u, long long h) {
  t++;
  in[u] = t;
  dp[h].push_back({t, dp[h].back().second ^ (1 << (s[u] - 'a'))});
  for (long long i = 0; i < child[u].size(); i++) {
    dfs(child[u][i], h + 1);
  }
  t++;
  out[u] = t;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, m;
  cin >> n >> m;
  for (long long i = 1; i < n; i++) {
    long long p;
    cin >> p;
    p--;
    child[p].push_back(i);
  }
  cin >> s;
  for (long long i = 0; i < n; i++) dp[i].resize(1);
  dfs(0, 0);
  for (long long i = 0; i < m; i++) {
    long long v, h;
    cin >> v >> h;
    v--, h--;
    long long l =
        lower_bound(dp[h].begin(), dp[h].end(), make_pair(in[v], -1ll)) -
        dp[h].begin() - 1;
    long long r =
        lower_bound(dp[h].begin(), dp[h].end(), make_pair(out[v], -1ll)) -
        dp[h].begin() - 1;
    long long val = dp[h][l].second ^ dp[h][r].second;
    long long cnt = 0;
    for (long long j = 0; j < 26; j++) {
      if (val & (1 << j)) cnt++;
    }
    if (cnt <= 1)
      cout << "Yes" << '\n';
    else
      cout << "No" << '\n';
  }
  return 0;
}
