#include <bits/stdc++.h>
using namespace std;
long long INV2 = 500000004;
long long INV6 = 166666668;
long long power(long long a, long long b, long long c) {
  long long x = 1, y = a;
  while (b > 0) {
    if (b & 1) x = (x * y) % c;
    y = (y * y) % c;
    b /= 2;
  }
  return x % c;
}
int dx[] = {0, -1, 0, 1};
int dy[] = {-1, 0, 1, 0};
int dr[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dc[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int N = 5e5 + 5;
vector<int> v[N], query[N];
int sz[N], level[N], big[N];
char s[N];
void dfs(int i, int par, int depth) {
  sz[i] = 1;
  level[i] = depth;
  for (int j = 0; j < v[i].size(); ++j) {
    int idx = v[i][j];
    if (idx != par) {
      dfs(idx, i, depth + 1);
      sz[i] += sz[idx];
    }
  }
  return;
}
int has[N][30];
void add(int i, int par, int depth) {
  has[depth][s[i - 1] - 'a']++;
  for (int j = 0; j < v[i].size(); ++j) {
    int idx = v[i][j];
    if (idx != par && !big[idx]) {
      add(idx, i, depth + 1);
    }
  }
  return;
}
void remove(int i, int par, int depth) {
  has[depth][s[i - 1] - 'a']--;
  for (int j = 0; j < v[i].size(); ++j) {
    int idx = v[i][j];
    if (idx != par && !big[idx]) {
      remove(idx, i, depth + 1);
    }
  }
  return;
}
map<pair<int, int>, bool> ans;
void hld(int i, int par, bool keep) {
  int bigchild = -1, mx = 0;
  for (int j = 0; j < v[i].size(); ++j) {
    int idx = v[i][j];
    if (idx != par && sz[idx] > mx) {
      mx = sz[idx];
      bigchild = idx;
    }
  }
  if (bigchild != -1) big[bigchild] = 1;
  for (int j = 0; j < v[i].size(); ++j) {
    int idx = v[i][j];
    if (idx != par && idx != bigchild) {
      hld(idx, i, 0);
    }
  }
  if (bigchild != -1) hld(bigchild, i, 1);
  add(i, par, level[i]);
  for (int j = 0; j < query[i].size(); ++j) {
    int lev = query[i][j], odd = 0;
    for (int k = 0; k < 26; ++k) {
      if (has[lev][k] & 1) odd++;
    }
    if (!odd || odd == 1) {
      ans[make_pair(i, lev)] = 1;
    }
  }
  if (bigchild != -1) big[bigchild] = 0;
  if (!keep) {
    remove(i, par, level[i]);
  }
  return;
}
pair<int, int> qu[N];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 2; i <= n; ++i) {
    int x;
    scanf("%d", &x);
    v[x].push_back(i);
    v[i].push_back(x);
  }
  scanf("%s", s);
  dfs(1, -1, 1);
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &qu[i].first, &qu[i].second);
    query[qu[i].first].push_back(qu[i].second);
  }
  hld(1, -1, 0);
  for (int i = 1; i <= m; ++i) {
    pair<int, int> pp = qu[i];
    if (ans[make_pair(pp.first, pp.second)]) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}
