#include <bits/stdc++.h>
using namespace std;
vector<long long int> graph[500005];
vector<long long int> ver[1000005];
vector<long long int> mask[1000005];
string s;
long long int tim = 1;
vector<long long int> ind[1000005];
long long int dis[1000005];
void et(long long int n) {
  ind[n].push_back(tim);
  ver[dis[n]].push_back(tim);
  tim++;
  long long int w = s[n] - 'a';
  mask[dis[n]].push_back(1 << (w));
  for (long long int i = 0; i < graph[n].size(); i++) {
    dis[graph[n][i]] = dis[n] + 1;
    et(graph[n][i]);
    tim++;
  }
  ind[n].push_back(tim);
  tim++;
}
bool ok[69000007];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ok[0] = 1;
  for (long long int i = 0; i <= 25; i++) {
    ok[1 << i] = 1;
  }
  long long int n, m;
  cin >> n >> m;
  long long int ww = m;
  for (long long int i = 2; i <= n; i++) {
    long long int p;
    cin >> p;
    graph[p].push_back(i);
  }
  cin >> s;
  s = '0' + s;
  for (long long int i = 0; i <= 500005; i++) {
    ver[i].push_back(0);
    mask[i].push_back(0);
  }
  et(1);
  for (long long int i = 0; i <= 500005; i++) {
    for (long long int j = 1; j < mask[i].size(); j++) {
      mask[i][j] ^= mask[i][j - 1];
    }
  }
  long long int cx = 0;
  while (m--) {
    cx++;
    long long int v, h;
    cin >> v >> h;
    if (ver[h - 1].size() <= 1) {
      cout << "Yes\n";
      continue;
    }
    long long int x = h - 1;
    long long int l = ind[v][0];
    long long int r = ind[v][1];
    long long int i1 =
        upper_bound(ver[x].begin(), ver[x].end(), l) - ver[x].begin();
    long long int i2 =
        upper_bound(ver[x].begin(), ver[x].end(), r) - ver[x].begin();
    i2--;
    i1--;
    if (ok[mask[x][i2] ^ mask[x][i1]]) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  }
}
