#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
inline void ptans(int ans) {
  for (int i = 1; i <= (1 << 25); i <<= 1)
    if (i & ans)
      std::cout << "1";
    else
      std::cout << "0";
}
int n, m, cnt[N], ans[N];
char s[N];
vector<int> mp[N];
vector<pair<int, int> > as[N];
void dfs(const int &p, const int &d) {
  for (int i = 0, I = as[p].size(); i < I; i++)
    ans[as[p][i].second] ^= cnt[as[p][i].first];
  for (int i = 0, I = mp[p].size(); i < I; i++) dfs(mp[p][i], d + 1);
  cnt[d] ^= 1 << (s[p] - 'a');
  for (int i = 0, I = as[p].size(); i < I; i++)
    ans[as[p][i].second] ^= cnt[as[p][i].first];
}
void init() {
  scanf("%d%d", &n, &m);
  for (int f, i = 2; i <= n; i++) {
    scanf("%d", &f);
    mp[f].push_back(i);
  }
  scanf("%s", s + 1);
  for (int i = 1, v, h; i <= m; i++) {
    scanf("%d%d", &v, &h);
    as[v].push_back(pair<int, int>(h, i));
  }
}
int main() {
  init();
  dfs(1, 1);
  for (int i = 1; i <= m; i++)
    if (ans[i] & (ans[i] - 1))
      puts("No");
    else
      puts("Yes");
  return 0;
}
