#include <bits/stdc++.h>
using namespace std;
template <typename T>
struct segtree {
  int n;
  vector<T> dat;
  T ZERO;
  segtree(int n_, T zero) : ZERO(zero) {
    n = 1;
    while (n < n_) n *= 2;
    dat.resize(2 * n);
    for (int i = 0; i < 2 * n; i++) dat[i] = ZERO;
  }
  void update(int k, T a) {
    k += n - 1;
    dat[k] = a;
    while (k > 0) {
      k = (k - 1) / 2;
      dat[k] = function(dat[k * 2 + 1], dat[k * 2 + 2]);
    }
  }
  void set(int k, T a) {
    k += n - 1;
    dat[k] = a;
  }
  void build() {
    for (int i = n - 2; i >= 0; i--) {
      dat[i] = function(dat[2 * i + 1], dat[2 * i + 2]);
    }
  }
  T function(T a, T b) { return a ^ b; }
  T get(int k) { return dat[k + n - 1]; }
  T que(int a, int b) {
    T L = ZERO, R = ZERO;
    int A = a + n - 1;
    int B = b + n - 1;
    while (A < B) {
      if ((A & 1) == 0) L = function(L, dat[A++]);
      if ((B & 1) == 0) R = function(dat[--B], R);
      A = A >> 1;
      B = B >> 1;
    }
    return function(L, R);
  }
};
int par[500050];
int L[500050];
int R[500050];
vector<vector<int>> depth(500050);
vector<vector<pair<int, int>>> que(500050);
vector<vector<int>> v(500050);
long long ans[500050];
string str;
int dfsCou;
void dfs(int a, int dep) {
  L[a] = dfsCou;
  dfsCou++;
  depth[dep].push_back(a);
  for (long long(i) = (0); (i) < (v[a].size()); ++i) {
    dfs(v[a][i], dep + 1);
  }
  R[a] = dfsCou;
  dfsCou++;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  for (long long(i) = (0); (i) < (n - 1); ++i) {
    cin >> par[i];
    par[i]--;
    v[par[i]].push_back(i + 1);
  }
  cin >> str;
  dfs(0, 0);
  for (long long(i) = (0); (i) < (m); ++i) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    que[b].emplace_back(a, i);
  }
  segtree<int> seg(2 * n + 10, 0);
  for (long long(i) = (0); (i) < (n); ++i) {
    for (long long(j) = (0); (j) < (depth[i].size()); ++j) {
      int id = depth[i][j];
      seg.update(L[id], (1 << (str[id] - 'a')));
    }
    for (long long(j) = (0); (j) < (que[i].size()); ++j) {
      int now = que[i][j].first;
      int id = que[i][j].second;
      ans[id] = seg.que(L[now], R[now]);
    }
    for (long long(j) = (0); (j) < (depth[i].size()); ++j) {
      int id = depth[i][j];
      seg.update(L[id], 0);
    }
  }
  for (long long(i) = (0); (i) < (m); ++i) {
    int cou = 0;
    for (long long(j) = (0); (j) < (30); ++j)
      if (ans[i] & (1 << j)) cou++;
    if (cou < 2)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
