#include <bits/stdc++.h>
using namespace std;
int save[1000000];
int arr[1000000];
int ans[1000000];
int st[1000000];
int fin[1000000];
int cost[1000000];
int lol[1000000];
int height[1000000];
int temp[1000000][30];
bool mark;
vector<pair<int, pair<int, pair<int, int> > > > v;
int maxi;
void add(int val, int pass) {
  int hi = lol[pass];
  temp[hi][val]++;
  return;
}
void reduce(int val, int pass) {
  int hi = lol[pass];
  temp[hi][val]--;
  return;
}
vector<int> v1[1000010];
int val = 1;
void dfs(int u, int par) {
  st[u] = val++;
  arr[val - 1] = cost[u];
  height[u] = height[par] + 1;
  lol[val - 1] = height[u];
  for (int i = 0; i < v1[u].size(); i++) {
    int s = v1[u][i];
    if (s == par) continue;
    dfs(s, u);
  }
  fin[u] = val++;
  arr[val - 1] = cost[u];
  lol[val - 1] = height[u];
  return;
}
int main() {
  int total, cnt;
  scanf("%d %d", &total, &cnt);
  for (int i = 2; i <= total; i++) {
    int a;
    scanf("%d", &a);
    v1[i].push_back(a);
    v1[a].push_back(i);
  }
  getchar();
  for (int i = 1; i <= total; i++) {
    char p;
    scanf("%c", &p);
    cost[i] = p - 'a' + 1;
  }
  dfs(1, 0);
  int temp1 = sqrt(cnt);
  for (int i = 1; i <= cnt; i++) {
    int l, r, h;
    scanf("%d %d", &l, &h);
    r = l;
    l = st[l];
    r = fin[r];
    v.push_back(make_pair(l / temp1, make_pair(r, make_pair(l, i))));
    save[i] = h;
  }
  sort(v.begin(), v.end());
  int left_pointer = 0;
  int right_pointer = 0;
  for (int i = 0; i < v.size(); i++) {
    int l = v[i].second.second.first;
    int pos = v[i].second.second.second;
    int r = v[i].second.first;
    int val;
    while (left_pointer < l) {
      val = arr[left_pointer];
      reduce(val, left_pointer);
      left_pointer++;
    }
    while (right_pointer > r + 1) {
      right_pointer--;
      val = arr[right_pointer];
      reduce(val, right_pointer);
    }
    while (left_pointer > l) {
      left_pointer--;
      val = arr[left_pointer];
      add(val, left_pointer);
    }
    while (right_pointer <= r) {
      val = arr[right_pointer];
      right_pointer++;
      add(val, right_pointer - 1);
    }
    int cool = save[pos];
    int cnt1 = 0;
    int cnt2 = 0, a, b;
    for (int i = 1; i <= 26; i++) {
      int a = temp[cool][i];
      if (!a) continue;
      a /= 2;
      a %= 2;
      if (a)
        cnt1++;
      else
        cnt2++;
    }
    if (cnt1 <= 1)
      ans[pos] = 1;
    else
      ans[pos] = 0;
  }
  for (int i = 1; i <= cnt; i++) {
    if (ans[i] == 1)
      printf("Yes\n");
    else
      printf("No\n");
  }
}
