#include <bits/stdc++.h>
using namespace std;
const double pi = 3.1415926535897932384626433832795;
const int inf = 1e9;
const long long inf2 = 1e18;
const int mod = 1e9 + 7;
void boost() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
const int N = 5e5 + 5;
vector<int> adj[N], second(N, 0), offset(N, 0);
map<int, int> mm[N];
vector<bool> ans(N, false);
vector<pair<int, int> > qry[N];
void merge(int u, int v) {
  if ((int)(mm[u].size()) < (int)(mm[v].size())) {
    swap(mm[u], mm[v]);
    swap(offset[u], offset[v]);
    offset[u]++;
    offset[v]--;
  }
  for (auto xx : mm[v]) {
    mm[u][xx.first + offset[v] + 1 - offset[u]] ^= xx.second;
  }
}
void dfs(int u, int d = 0) {
  for (auto v : adj[u]) {
    dfs(v, d + 1);
    merge(u, v);
  }
  for (auto xx : qry[u]) {
    if (mm[u].find(xx.second - d - offset[u]) != mm[u].end())
      ans[xx.first] =
          (__builtin_popcount(mm[u][xx.second - d - offset[u]]) <= 1);
    else
      ans[xx.first] = true;
  }
}
void solve() {
  int n, m, p, h;
  cin >> n >> m;
  for (int i = 2; i <= n; i++) {
    cin >> p;
    adj[p].push_back(i);
  }
  char x;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    mm[i][1] = (1 << ((int)(x - 'a')));
  }
  for (int i = 0; i < m; i++) {
    cin >> p >> h;
    qry[p].push_back({i, h});
  }
  dfs(1);
  for (int i = 0; i < m; i++)
    if (ans[i])
      cout << "Yes\n";
    else
      cout << "No\n";
  return;
}
int main() {
  boost();
  int tc = 1;
  while (tc--) solve();
  return 0;
}
