#include <bits/stdc++.h>
using namespace std;
int start_time[500001], end_time[500001];
vector<int> Adj[500001];
vector<pair<int, int> > level[500001];
vector<int> Ans[500001];
int tim_0 = -1;
void DFS(int u, int lvl) {
  tim_0++;
  start_time[u] = tim_0;
  level[lvl].push_back(pair<int, int>(tim_0, u));
  for (auto v : Adj[u]) DFS(v, lvl + 1);
  tim_0++;
  end_time[u] = tim_0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int N, M, x, l, r, i, j;
  string A;
  cin >> N >> M;
  vector<int> val(N + 1);
  for (i = 2; i <= N; ++i) {
    cin >> x;
    Adj[x].push_back(i);
  }
  cin >> A;
  for (i = 1; i <= A.length(); ++i) val[i] = (1 << (int)A[i - 1] - 'a');
  DFS(1, 1);
  for (i = 1; i <= N; ++i) {
    for (j = 0; j < (int)level[i].size(); ++j) {
      if (j == 0) {
        Ans[i].push_back(val[level[i][j].second]);
        continue;
      }
      Ans[i].push_back(val[level[i][j].second] ^
                       Ans[i][(int)Ans[i].size() - 1]);
    }
  }
  for (; M; --M) {
    cin >> l >> r;
    if (level[r].size() == 0) {
      cout << "Yes\n";
      continue;
    }
    x = r;
    int y1 = upper_bound(level[x].begin(), level[x].end(),
                         make_pair(end_time[l], -1)) -
             level[x].begin();
    int y2 = lower_bound(level[x].begin(), level[x].end(),
                         make_pair(start_time[l], -1)) -
             level[x].begin();
    --y1;
    --y2;
    if (y1 >= 0)
      cout << (__builtin_popcount(Ans[x][y1] ^ (y2 >= 0 ? Ans[x][y2] : 0)) > 1
                   ? "No"
                   : "Yes")
           << "\n";
    else
      cout << "Yes\n";
  }
  return 0;
}
