#include <bits/stdc++.h>
using namespace std;
int n, m;
char c[500005];
int mx[500005], h[500005], sz[500005];
int cntt[500005];
map<int, bool> cnt[28];
vector<int> g[500005];
vector<pair<int, int> > q[500005];
bool ans[500005];
void get_sz(int v) {
  ++sz[v];
  mx[v] = -1;
  for (auto to : g[v]) {
    h[to] = h[v] + 1;
    get_sz(to);
    sz[v] += sz[to];
    if (mx[v] == -1 || sz[mx[v]] < sz[to]) mx[v] = to;
  }
}
inline void adi(int v) {
  int clr = int(c[v] - 'a');
  cntt[h[v]] -= cnt[clr][h[v]];
  cnt[clr][h[v]] ^= 1;
  cntt[h[v]] += cnt[clr][h[v]];
}
void add(int v) {
  adi(v);
  for (auto to : g[v]) add(to);
}
void dfs(int v, bool isBig = 0) {
  for (auto to : g[v])
    if (to != mx[v]) dfs(to, 0);
  if (mx[v] != -1) dfs(mx[v], 1);
  adi(v);
  for (auto to : g[v])
    if (to != mx[v]) add(to);
  for (auto it : q[v]) {
    ans[it.second] = (cntt[it.first] <= 1);
  }
  if (!isBig) add(v);
}
inline void solve() {
  cin >> n >> m;
  for (int i = 2; i <= n; ++i) {
    int x;
    cin >> x;
    g[x].push_back(i);
  }
  for (int i = 1; i <= n; ++i) cin >> c[i];
  for (int i = 1; i <= m; ++i) {
    int v, hh;
    cin >> v >> hh;
    q[v].push_back(make_pair(hh, i));
  }
  h[1] = 1;
  get_sz(1);
  dfs(1);
  for (int i = 1; i <= m; ++i) {
    if (ans[i])
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
