#include <bits/stdc++.h>
using namespace std;
vector<int> g[500005];
char chr[500005];
int anak[500005];
vector<pair<int, int> > asd[500005];
bool big[500005];
int cnt[500005][30];
int depth[500005];
bool ans[500005];
int ganjil[500005];
void rekur(int a, int s, int d) {
  int e = g[a].size();
  depth[a] = d;
  anak[a] = 1;
  for (int q = 0; q < e; q++)
    if (g[a][q] != s) rekur(g[a][q], a, d + 1), anak[a] += anak[g[a][q]];
}
void add(int a, int s) {
  int temp = chr[a] - 'a';
  cnt[depth[a]][temp]++;
  if (cnt[depth[a]][temp] % 2 == 1)
    ganjil[depth[a]]++;
  else
    ganjil[depth[a]]--;
  int e = g[a].size();
  for (int q = 0; q < e; q++) {
    if (g[a][q] != s && !big[g[a][q]]) add(g[a][q], a);
  }
}
void rem(int a, int s) {
  int temp = chr[a] - 'a';
  cnt[depth[a]][temp]--;
  if (cnt[depth[a]][temp] % 2 == 1)
    ganjil[depth[a]]++;
  else
    ganjil[depth[a]]--;
  int e = g[a].size();
  for (int q = 0; q < e; q++) {
    if (g[a][q] != s && !big[g[a][q]]) rem(g[a][q], a);
  }
}
void dfs(int a, int s, bool keep) {
  int bigC = -1, maks = 0;
  int e = g[a].size();
  for (int q = 0; q < e; q++) {
    if (g[a][q] != s && anak[g[a][q]] > maks)
      maks = anak[g[a][q]], bigC = g[a][q];
  }
  for (int q = 0; q < e; q++) {
    if (g[a][q] != s && g[a][q] != bigC) dfs(g[a][q], a, 0);
  }
  if (bigC != -1) dfs(bigC, a, 1), big[bigC] = 1;
  add(a, s);
  for (int q = 0; q < asd[a].size(); q++) {
    if (ganjil[asd[a][q].second] <= 1) ans[asd[a][q].first] = true;
  }
  if (bigC != -1) big[bigC] = 0;
  if (keep == false) {
    rem(a, s);
  }
}
int main() {
  int z, x;
  scanf("%d%d", &z, &x);
  int a, s;
  for (int q = 2; q <= z; q++) {
    scanf("%d", &a);
    g[q].push_back(a);
    g[a].push_back(q);
  }
  for (int q = 1; q <= z; q++) {
    scanf(" %c", &chr[q]);
  }
  for (int q = 1; q <= x; q++) {
    scanf("%d%d", &a, &s);
    asd[a].push_back(make_pair(q, s));
  }
  rekur(1, -1, 1);
  dfs(1, -1, 1);
  for (int q = 1; q <= x; q++) {
    if (ans[q])
      printf("Yes\n");
    else
      printf("No\n");
  }
}
