#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using ll = long long;
vi in, out, p, d;
vector<vi> childs;
vector<char> chars;
int dfs_count = 0;
int max_depth = 1;
void dfs(int u) {
  in[u] = ++dfs_count;
  if (u != 0) d[u] = 1 + d[p[u]], max_depth = max(max_depth, d[u]);
  for (auto& v : childs[u]) dfs(v);
  out[u] = ++dfs_count;
}
struct X {
  int in;
  unsigned int xor_prefix;
  bool operator<(const X& r) const { return in < r.in; }
};
vector<vector<X>> bfs_order;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int N, Q;
  cin >> N >> Q;
  in.resize(N), out.resize(N);
  p.assign(N, -1);
  d.assign(N, -1);
  childs.assign(N, vi());
  chars.resize(N);
  for (int i = 1; i < N; i++) cin >> p[i], p[i]--, childs[p[i]].push_back(i);
  cin >> ws;
  for (auto i = decltype(N)(0); i < (N); i++) cin >> chars[i], chars[i] -= 'a';
  d[0] = 1;
  dfs(0);
  bfs_order.assign(max_depth + 1, vector<X>{{-1, 0}});
  queue<int> q;
  q.push(0);
  while (!q.empty()) {
    auto u = q.front();
    q.pop();
    auto xor_prefix = (1 << chars[u]) ^ bfs_order[d[u]].back().xor_prefix;
    bfs_order[d[u]].push_back({in[u], xor_prefix});
    for (auto& v : childs[u]) q.push(v);
  }
  for (auto i = decltype(Q)(0); i < (Q); i++) {
    int u, depth;
    cin >> u >> depth;
    u--;
    if (depth > max_depth) {
      cout << "Yes\n";
      continue;
    }
    auto first = lower_bound(begin(bfs_order[depth]), end(bfs_order[depth]),
                             X{in[u], 0});
    first = prev(first);
    auto last = lower_bound(begin(bfs_order[depth]), end(bfs_order[depth]),
                            X{out[u], 0});
    last = prev(last);
    auto xor_range = last->xor_prefix ^ first->xor_prefix;
    cout << (__builtin_popcount(xor_range) <= 1 ? "Yes" : "No") << "\n";
  }
  return 0;
}
