#include <bits/stdc++.h>
using namespace std;
int sz[500005], depth[500005];
char c[500005];
vector<int> al[500005];
map<int, vector<int>>* mp[500005];
map<int, vector<pair<long long, long long>>> queries;
bool ans[500005];
void dfsSz(int node) {
  sz[node] = 1;
  for (auto x : al[node]) {
    depth[x] = depth[node] + 1;
    dfsSz(x);
    sz[node] += sz[x];
  }
}
void dfs(int node) {
  int bigChild = -1, mx = -1;
  for (auto x : al[node]) {
    if (sz[x] > mx) {
      mx = sz[x];
      bigChild = x;
    }
  }
  if (bigChild != -1) {
    dfs(bigChild);
    mp[node] = mp[bigChild];
  } else
    mp[node] = new map<int, vector<int>>();
  for (auto x : al[node]) {
    if (x != bigChild) {
      dfs(x);
      for (const auto& p : (*mp[x])) {
        int level = p.first;
        if (mp[node]->count(level) == 0)
          (*mp[node])[level] = vector<int>(26, 0);
        for (int i = 0; i < 26; i++)
          (*mp[node])[level][i] += (*mp[x])[level][i];
      }
    }
  }
  if (mp[node]->count(depth[node]) == 0)
    (*mp[node])[depth[node]] = vector<int>(26, 0);
  (*mp[node])[depth[node]][c[node] - 'a']++;
  for (auto p : queries[node]) {
    int total = 0;
    int dep = p.first;
    if ((mp[node]->count(dep)) == 0) {
      ans[p.second] = 1;
      goto loop;
    }
    for (int i = 0; i < 26; i++) {
      total += (*mp[node])[dep][i];
    }
    if (total % 2 == 0) {
      for (int i = 0; i < 26; i++) {
        if ((*mp[node])[dep][i] % 2 != 0) {
          ans[p.second] = 0;
          goto loop;
        }
      }
      ans[p.second] = 1;
    } else {
      int odd = 0;
      for (int i = 0; i < 26; i++) {
        if ((*mp[node])[dep][i] % 2 != 0) {
          odd++;
          if (odd == 2) {
            ans[p.second] = 0;
            goto loop;
          }
        }
      }
      if (odd == 1)
        ans[p.second] = 1;
      else
        ans[p.second] = 0;
    }
  loop:;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 2; i < n + 1; i++) {
    int k;
    cin >> k;
    al[k].emplace_back(i);
  }
  for (int i = 1; i < n + 1; i++) cin >> c[i];
  for (int i = 0; i < m; i++) {
    int v, h;
    cin >> v >> h;
    if (queries.count(v))
      queries[v].emplace_back(h, i);
    else
      queries[v] = vector<pair<long long, long long>>{{h, i}};
  }
  depth[1] = 1;
  dfsSz(1);
  dfs(1);
  for (int i = 0; i < m; i++) cout << (ans[i] ? "Yes" : "No") << "\n";
}
