#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
const long long MOD = 1e9 + 7;
const double err = 1e-10;
const int N = 5e5 + 5;
int n, m, dfstime = -1;
vector<vector<int>> adj(N);
string s;
vector<int> dfsin(N), dfsout(N);
vector<vector<pair<int, int>>> level(N);
void dfs(int u, int lvl) {
  dfsin[u] = ++dfstime;
  int prev = (level[lvl].empty() ? 0 : level[lvl].back().second);
  prev = (prev ^ (1 << (s[u] - 'a')));
  level[lvl].push_back({dfstime, prev});
  for (auto v : adj[u]) {
    dfs(v, lvl + 1);
  }
  dfsout[u] = dfstime;
}
void solve() {
  cin >> n >> m;
  for (int i = 0; i < n - 1; i++) {
    int p;
    cin >> p;
    adj[p - 1].push_back(i + 1);
  }
  cin >> s;
  dfs(0, 1);
  for (int i = 0; i < m; i++) {
    int v, h;
    cin >> v >> h;
    v--;
    auto it1 = lower_bound((level[h]).begin(), (level[h]).end(),
                           make_pair(dfsin[v], 0));
    auto it2 = lower_bound((level[h]).begin(), (level[h]).end(),
                           make_pair(dfsout[v] + 1, 0));
    if (it1 == level[h].end() || it2 == level[h].begin()) {
      cout << "Yes" << endl;
      continue;
    }
    it2--;
    int val;
    if (it1 == level[h].begin()) {
      val = (*it2).second;
    } else {
      val = (((*prev(it1)).second) ^ ((*it2).second));
    }
    if (__builtin_popcount(val) <= 1) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int T = 1;
  while (T--) solve();
  return 0;
}
