#include <bits/stdc++.h>
using namespace std;
const int Maxn = 5e5 + 100;
int n, q, Time, V, H;
int par[Maxn], str[Maxn], fin[Maxn], h[Maxn];
string s;
vector<int> level[Maxn], nei[Maxn];
vector<vector<int> > d[Maxn];
void input();
void dfs(int v, int l);
bool OK();
bool comp(const int &a, const int &b);
void output();
int main() {
  input();
  dfs(0, 0);
  output();
  return 0;
}
void input() {
  cin >> n >> q;
  for (int i = 0; i < n - 1; i++) {
    scanf("%d", &par[i + 1]);
    nei[--par[i + 1]].push_back(i + 1);
  }
  cin >> s;
  return;
}
void dfs(int v, int l) {
  if (level[l].size() == 0) {
    vector<int> emp;
    for (int i = 0; i < 26; i++) emp.push_back(0);
    emp[s[v] - 'a']++;
    d[l].push_back(emp);
  } else {
    d[l].back()[s[v] - 'a']++;
    d[l].push_back(d[l].back());
    d[l][d[l].size() - 2][s[v] - 'a']--;
  }
  h[v] = l;
  level[l].push_back(v);
  Time++;
  str[v] = Time;
  for (int i = 0; i < int(nei[v].size()); i++) dfs(nei[v][i], l + 1);
  Time++;
  fin[v] = Time;
  return;
}
bool OK() {
  if (H <= h[V]) return true;
  if (level[H].size() == 0) return true;
  int S =
      lower_bound(level[H].begin(), level[H].end(), V, comp) - level[H].begin();
  swap(str[V], fin[V]);
  int E =
      upper_bound(level[H].begin(), level[H].end(), V, comp) - level[H].begin();
  swap(str[V], fin[V]);
  if (S == E) return true;
  int odd = 0;
  for (int i = 0; i < 26; i++)
    if ((d[H][E - 1][i] - (S == 0 ? 0 : d[H][S - 1][i])) % 2) odd++;
  if (odd > 1) return false;
  return true;
}
bool comp(const int &a, const int &b) { return str[a] < str[b]; }
void output() {
  for (int i = 0; i < q; i++) {
    scanf("%d %d", &V, &H);
    H--;
    V--;
    if (OK())
      printf("Yes \n");
    else
      printf("No \n");
  }
  return;
}
