#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
void tracer(istream_iterator<string> it) {}
template <typename T, typename... Args>
void tracer(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << " | ";
  tracer(++it, args...);
}
const long long MOD = 1e9 + 7;
const double err = 1e-10;
const int N = 5e5 + 5;
vector<vector<int>> adj(N);
string s;
unordered_map<int, multiset<pair<int, int>>> mp;
int timer = 0;
vector<int> tin(N), tout(N);
void lca_dfs(int u, int h) {
  tin[u] = ++timer;
  int mask, val = (s[u - 1] - 'a');
  if (mp[h].empty())
    mask = 0;
  else
    mask = (*mp[h].rbegin()).second;
  mask = (mask ^ (1 << val));
  mp[h].insert(make_pair(tin[u], mask));
  for (int v : adj[u]) {
    lca_dfs(v, h + 1);
  }
  tout[u] = timer;
}
void solve() {
  int n, m;
  cin >> n >> m;
  for (int i = 2; i < n + 1; i++) {
    int p;
    cin >> p;
    adj[p].push_back(i);
  }
  cin >> s;
  lca_dfs(1, 1);
  for (int i = 0; i < m; i++) {
    int v, h;
    cin >> v >> h;
    auto it1 = mp[h].lower_bound(make_pair(tin[v], -1));
    if (it1 == mp[h].end()) {
      cout << "Yes\n";
      continue;
    }
    auto it2 = mp[h].lower_bound(make_pair(tout[v] + 1, -1));
    if (it2 == it1) {
      cout << "Yes\n";
      continue;
    }
    it2--;
    int mask;
    if (it1 == mp[h].begin()) {
      mask = (*it2).second;
    } else {
      it1--;
      int maska = (*it1).second, maskb = (*it2).second;
      mask = (maska ^ maskb);
    }
    if (__builtin_popcount(mask) <= 1) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int T = 1;
  while (T--) solve();
  return 0;
}
