#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > adj(500001), aux(500001), aux_time(500001);
string st;
int l[500001], r[500001], curr = 1;
void dfs(int node = 1, int depth = 1) {
  l[node] = curr;
  aux[depth].push_back((1 << (st[node - 1] - 'a')) ^ (aux[depth].back()));
  aux_time[depth].push_back(curr);
  curr++;
  for (int i = 0; i < adj[node].size(); ++i) dfs(adj[node][i], depth + 1);
  r[node] = curr - 1;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  for (int i = 0; i < 500001; ++i) {
    aux[i].push_back(0);
    aux_time[i].push_back(-1);
  }
  int n, m;
  cin >> n >> m;
  for (int i = 2; i <= n; ++i) {
    int a;
    cin >> a;
    adj[a].push_back(i);
  }
  cin >> st;
  dfs();
  while (m--) {
    int u, v;
    cin >> u >> v;
    int l1 = upper_bound(aux_time[v].begin(), aux_time[v].end(), l[u]) -
             aux_time[v].begin();
    int r1 = upper_bound(aux_time[v].begin(), aux_time[v].end(), r[u]) -
             aux_time[v].begin();
    if ((aux[v][r1 - 1] ^ aux[v][l1 - 1]) == 0 ||
        __builtin_popcount(aux[v][r1 - 1] ^ aux[v][l1 - 1]) == 1)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
