#include <bits/stdc++.h>
using namespace std;
const long long inf_int = 1e9 + 10;
const long long inf_ll = 1e18;
void read(int &x) { scanf("%d", &x); }
void read(long long &x) { scanf("%lld", &x); }
template <class H, class... T>
void read(H &h, T &...t) {
  read(h);
  read(t...);
}
void pt() { cout << '\n'; }
template <class H, class... T>
void pt(H h, T... t) {
  cout << " " << h;
  pt(t...);
}
const long long maxn = 5e5 + 10;
int N, M;
int h[maxn], e[maxn], ne[maxn], idx = 1;
char col[maxn];
int cnt[maxn][30], ji[maxn];
int sz[maxn], hson[maxn], dep[maxn];
pair<long long, long long> in[maxn];
map<pair<long long, long long>, bool> ans;
vector<int> adj[maxn];
void add(int a, int b) {
  e[++idx] = b;
  ne[idx] = h[a];
  h[a] = idx;
}
void dfs1(int u, int fa, int d) {
  dep[u] = d;
  sz[u] = 1;
  hson[u] = -1;
  for (int i = h[u]; i; i = ne[i]) {
    int v = e[i];
    if (v == fa) continue;
    dfs1(v, u, d + 1);
    if (hson[u] == -1 || sz[v] > sz[hson[u]]) {
      hson[u] = v;
    }
    sz[u] += sz[v];
  }
}
void update(int u, int fa, int val) {
  if (val == +1) {
    cnt[dep[u]][col[u] - 'a'] += val;
    if (cnt[dep[u]][col[u] - 'a'] % 2 == 0)
      ji[dep[u]]--;
    else
      ji[dep[u]]++;
  } else {
    cnt[dep[u]][col[u] - 'a'] = 0;
    ji[dep[u]] = 0;
  }
  for (int i = h[u]; i; i = ne[i]) {
    int v = e[i];
    if (v == fa) continue;
    update(v, u, val);
  }
}
void dfs2(int u, int fa, int op) {
  for (int i = h[u]; i; i = ne[i]) {
    int v = e[i];
    if (v == fa || v == hson[u]) continue;
    dfs2(v, u, 0);
  }
  if (hson[u] != -1) {
    dfs2(hson[u], u, 1);
  }
  for (int i = h[u]; i; i = ne[i]) {
    int v = e[i];
    if (v == fa || v == hson[u]) continue;
    update(v, u, +1);
  }
  for (auto v : adj[u]) {
    if (v <= dep[u]) {
      ans[{u, v}] = 1;
    } else {
      if (ji[v] > 1)
        ans[{u, v}] = 0;
      else
        ans[{u, v}] = 1;
    }
  }
  cnt[dep[u]][col[u] - 'a'] += 1;
  if (cnt[dep[u]][col[u] - 'a'] % 2 == 0)
    ji[dep[u]]--;
  else
    ji[dep[u]]++;
  if (!op) {
    update(u, fa, -1);
  }
}
int main() {
  read(N, M);
  for (int i = 2; i <= N; i++) {
    int f;
    read(f);
    add(f, i);
  }
  scanf("%s", col + 1);
  for (int i = 1; i <= M; i++) {
    int a, b;
    read(a, b);
    in[i] = {a, b};
    adj[a].push_back(b);
  }
  dfs1(1, -1, 1);
  dfs2(1, -1, 1);
  for (int i = 1; i <= M; i++) {
    if (ans[in[i]])
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
