#include <bits/stdc++.h>
using namespace std;
vector<int> v[523456];
vector<pair<int, int> > h[523456];
int dfsn[523456];
int dfsf[523456];
int a[33];
int timer = 0;
string s;
void dfs(int node, int hh) {
  int z = v[node].size();
  int nd;
  dfsn[node] = ++timer;
  pair<int, int> p = {timer, h[hh].back().second ^ a[s[node] - 'a']};
  h[hh].push_back(p);
  for (int i = 0; i < z; i++) {
    nd = v[node][i];
    dfs(nd, hh + 1);
  }
  dfsf[node] = ++timer;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  int x, y;
  for (int i = 0; i <= n; i++) {
    h[i].resize(1);
  }
  for (int i = 0; i < 30; i++) {
    a[i] = (1 << i);
  }
  for (int i = 1; i < n; i++) {
    cin >> x;
    v[x - 1].push_back(i);
  }
  cin >> s;
  dfs(0, 0);
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    x--;
    y--;
    pair<int, int> p1 = {dfsn[x], -1};
    pair<int, int> p2 = {dfsf[x], -1};
    int st = lower_bound(h[y].begin(), h[y].end(), p1) - h[y].begin() - 1;
    int en = lower_bound(h[y].begin(), h[y].end(), p2) - h[y].begin() - 1;
    int t = h[y][st].second ^ h[y][en].second;
    bool yes = t - (t & -t);
    if (yes)
      cout << "No\n";
    else
      cout << "Yes\n";
  }
  return 0;
}
