#include <bits/stdc++.h>
using namespace std;
void computeDepth(int vertex, int depth, const vector<vector<int>> &children,
                  const vector<char> &vertexChar, int &t,
                  vector<int> &enterTime, vector<int> &exitTime,
                  vector<vector<int>> &depthToTimes,
                  vector<vector<int>> &depthToCharCounts) {
  depthToTimes[depth].push_back(t);
  depthToCharCounts[depth].push_back(depthToCharCounts[depth].back() ^
                                     (1 << (vertexChar[vertex] - 'a')));
  enterTime[vertex] = t++;
  for (int nextVertex : children[vertex]) {
    computeDepth(nextVertex, depth + 1, children, vertexChar, t, enterTime,
                 exitTime, depthToTimes, depthToCharCounts);
  }
  exitTime[vertex] = t++;
}
int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int N, M;
  cin >> N >> M;
  vector<int> parent(N, -1);
  vector<vector<int>> children(N);
  for (int i = 1; i < N; ++i) {
    cin >> parent[i];
    --parent[i];
    children[parent[i]].push_back(i);
  }
  vector<char> vertexChar;
  for (int i = 0; i < N; ++i) {
    char c;
    cin >> c;
    vertexChar.push_back(c);
  }
  vector<int> enterTime(N, -1);
  vector<int> exitTime(N, -1);
  vector<vector<int>> depthToTimes(N, vector<int>{0});
  vector<vector<int>> depthToCharCounts(N, vector<int>{0});
  int t = 1;
  computeDepth(0, 0, children, vertexChar, t, enterTime, exitTime, depthToTimes,
               depthToCharCounts);
  vector<string> isPalindrome;
  for (int i = 0; i < M; ++i) {
    int vertex, depth;
    cin >> vertex >> depth;
    --vertex;
    --depth;
    int lowerIdx = (lower_bound(depthToTimes[depth].begin(),
                                depthToTimes[depth].end(), enterTime[vertex]) -
                    depthToTimes[depth].begin()) -
                   1;
    int upperIdx = (lower_bound(depthToTimes[depth].begin(),
                                depthToTimes[depth].end(), exitTime[vertex]) -
                    depthToTimes[depth].begin()) -
                   1;
    int charCount =
        depthToCharCounts[depth][lowerIdx] ^ depthToCharCounts[depth][upperIdx];
    bool possiblePalindrome =
        charCount - (charCount & -charCount) > 0 ? false : true;
    isPalindrome.push_back(possiblePalindrome ? "Yes" : "No");
  }
  copy(isPalindrome.begin(), isPalindrome.end(),
       ostream_iterator<string>(cout, "\n"));
  cout << flush;
  return 0;
}
