#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:667772160")
using namespace std;
struct __isoff {
  __isoff() {
    if (0) freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
    srand(time(0));
  }
  ~__isoff() {}
} __osafwf;
const unsigned long long p1 = 31;
const unsigned long long p2 = 29;
const double eps = 1e-8;
const double pi = acos(-1.0);
const long long inf = 1e17 + 7;
const int infi = 1e9 + 7;
const long long dd = 2e6 + 7;
const long long mod = 1e9 + 7;
int n, m;
vector<int> P[dd];
vector<pair<int, int> > H[dd];
int In[dd], Out[dd];
int A[30];
int ti = 0;
string s;
void dfs(int v, int h) {
  In[v] = ++ti;
  H[h].push_back(make_pair(ti, H[h].back().second ^ A[s[v] - 'a']));
  for (long long i = 0; i < (long long)P[v].size(); i++) dfs(P[v][i], h + 1);
  Out[v] = ++ti;
}
int main() {
  cin >> n >> m;
  for (long long i = 0; i < (long long)n; i++) H[i].resize(1);
  for (long long i = 0; i < (long long)30; i++) A[i] = 1 << i;
  for (long long i = 0; i < (long long)n - 1; i++) {
    int t;
    scanf("%d", &t);
    P[t - 1].push_back(i + 1);
  }
  cin >> s;
  dfs(0, 0);
  for (long long i = 0; i < (long long)m; i++) {
    int h, v;
    scanf("%d%d", &v, &h);
    v--, h--;
    int l = lower_bound(H[h].begin(), H[h].end(), make_pair(In[v], -1)) -
            H[h].begin() - 1;
    int r = lower_bound(H[h].begin(), H[h].end(), make_pair(Out[v], -1)) -
            H[h].begin() - 1;
    int t = H[h][l].second ^ H[h][r].second;
    if (__builtin_popcount(t) <= 1)
      printf("Yes\n");
    else
      printf("No\n");
  }
}
