#include <bits/stdc++.h>
int main() {
  std::string str;
  std::cin >> str;
  std::map<char, std::vector<int32_t> > positions;
  for (int32_t i = 0; i < str.size(); i++) positions[str[i]].push_back(i);
  int32_t num_queries;
  std::cin >> num_queries;
  for (int32_t q = 0; q < num_queries; q++) {
    int32_t left, right;
    std::cin >> left >> right;
    left--;
    right--;
    if (right == left || str[left] != str[right]) {
      std::cout << "Yes"
                << "\n";
      continue;
    }
    if (right == left + 1) {
      std::cout << "No"
                << "\n";
      continue;
    }
    bool answer;
    int32_t distinct = 0;
    for (auto it = positions.begin(); it != positions.end(); it++) {
      int32_t left2 = -1;
      int32_t right2 = it->second.size();
      while (right2 - left2 > 1) {
        int32_t m = (left2 + right2) / 2;
        if (it->second[m] < left)
          left2 = m;
        else
          right2 = m;
      }
      if (right2 < it->second.size())
        if (it->second[right2] <= right) distinct++;
    }
    answer = distinct >= 3;
    if (answer) {
      std::cout << "Yes"
                << "\n";
    } else {
      std::cout << "No"
                << "\n";
    }
  }
  return 0;
}
