#include <bits/stdc++.h>
using namespace std;
using namespace std;
long long powm(long long base, long long exp, long long mod = 1000000007) {
  long long ans = 1;
  while (exp) {
    if (exp & 1) ans = (ans * base) % mod;
    exp >>= 1, base = (base * base) % mod;
  }
  return ans;
}
int parity[500005], ans[500005], cnt[500005][26], sz[500005], mk[500005],
    level[500005];
vector<int> adj[500005];
vector<pair<int, int>> queries[500005];
string second;
void pre(int curr = 1) {
  sz[curr] = 1;
  for (auto i : adj[curr])
    level[i] = level[curr] + 1, pre(i), sz[curr] += sz[i];
}
void update(int curr) {
  parity[level[curr]] -= cnt[level[curr]][second[curr] - 'a'];
  cnt[level[curr]][second[curr] - 'a'] ^= 1;
  parity[level[curr]] += cnt[level[curr]][second[curr] - 'a'];
  for (auto i : adj[curr])
    if (!mk[i]) update(i);
}
void dfs(int curr = 1, int keep = 0) {
  int mx = 0, big = -1;
  for (auto i : adj[curr])
    if (sz[i] > mx) mx = sz[i], big = i;
  for (auto i : adj[curr])
    if (i != big) dfs(i, 1);
  if (big != -1) mk[big] = 1, dfs(big);
  update(curr);
  for (auto q : queries[curr]) ans[q.second] = (parity[q.first] <= 1LL);
  if (big != -1) mk[big] = 0;
  if (keep) update(curr);
}
int main() {
  int n, u, v, m, x;
  scanf("%d", &n), scanf("%d", &m), level[1] = 1;
  for (int i = 1; i < n; i++) scanf("%d", &x), adj[x].push_back(i + 1);
  cin >> second, second = " " + second;
  for (int i = 0; i < m; i++)
    scanf("%d", &u), scanf("%d", &v), queries[u].push_back({v, i});
  pre(), dfs();
  for (int i = 0; i < m; i++)
    if (ans[i])
      printf("Yes\n");
    else
      printf("No\n");
  return 0;
}
