#include <bits/stdc++.h>
using namespace std;
const int N = 5 * (long long int)100001;
vector<vector<long long int> > g(N);
int st[N], sz[N], clocked[N], dep[N];
int timed = 0;
void pre(int v, int p) {
  st[v] = timed;
  clocked[timed] = v;
  timed++;
  for (auto vv : g[v]) {
    if (vv == p) continue;
    dep[vv] = dep[v] + 1;
    pre(vv, v);
    sz[v] += sz[vv];
  }
  sz[v]++;
}
map<pair<long long int, long long int>, int> ANS;
int freq[N][26];
char ch[N];
vector<pair<long long int, long long int> > ok;
vector<long long int> queries[N];
void dfs(int v, int p, bool keep) {
  int mx = -1, bigChild = -1;
  for (auto u : g[v])
    if (u != p && sz[u] > mx) mx = sz[u], bigChild = u;
  for (auto u : g[v])
    if (u != p && u != bigChild) dfs(u, v, 0);
  if (bigChild != -1) dfs(bigChild, v, 1);
  for (auto u : g[v])
    if (u != p && u != bigChild)
      for (int timed = st[u]; timed < st[u] + sz[u]; timed++) {
        freq[dep[clocked[timed]]][ch[clocked[timed]] - 97]++;
      }
  freq[dep[v]][ch[v] - 97]++;
  for (auto qq : queries[v]) {
    int sum = 0;
    for (long long int i = 0; i < 26; i++) sum += (freq[qq][i] % 2);
    if (sum < 2) ANS[{v, qq}] = 1;
  }
  if (keep == 0)
    for (int timed = st[v]; timed < st[v] + sz[v]; timed++)
      freq[dep[clocked[timed]]][ch[clocked[timed]] - 97]--;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, q;
  cin >> n >> q;
  for (long long int i = 1; i < n; i++) {
    int a;
    cin >> a;
    g[a - 1].push_back(i);
  }
  for (long long int i = 0; i < n; i++) cin >> ch[i];
  for (long long int i = 0; i < q; i++) {
    int v, h;
    cin >> v >> h;
    v--;
    queries[v].push_back(h);
    ok.push_back({v, h});
  }
  dep[0] = 1;
  pre(0, -1);
  dfs(0, -1, 0);
  for (auto pp : ok) cout << (ANS.count(pp) ? "Yes\n" : "No\n");
}
