#include <bits/stdc++.h>
using namespace std;
const double pi = 3.1415926535897932384626433832795;
const int inf = 1e9;
const long long inf2 = 1e18;
const int mod = 1e9 + 7;
void boost() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
const int N = 5e5 + 5;
vector<int> adj[N], tin(N, 0), tout(N, 0);
vector<pair<int, int>> H[N];
int timer = 0;
string s;
void dfs(int u, int d = 1) {
  tin[u] = ++timer;
  H[d].push_back({timer, H[d].back().second ^ (1 << ((int)(s[u - 1] - 'a')))});
  for (auto v : adj[u]) dfs(v, d + 1);
  tout[u] = ++timer;
}
void solve() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i <= n + 2; i++) {
    H[i].resize(1);
  }
  int p, h;
  for (int i = 2; i <= n; i++) {
    cin >> p;
    adj[p].push_back(i);
  }
  cin >> s;
  dfs(1);
  while (m--) {
    cin >> p >> h;
    p = (*(lower_bound(H[h].begin(), H[h].end(), make_pair(tin[p], -1)) - 1))
            .second ^
        (*(lower_bound(H[h].begin(), H[h].end(), make_pair(tout[p], -1)) - 1))
            .second;
    p = __builtin_popcount(p);
    if (p <= 1)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return;
}
int main() {
  boost();
  int tc = 1;
  while (tc--) solve();
  return 0;
}
