#include <bits/stdc++.h>
using namespace std;
constexpr long long mod = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  string s;
  std::cin >> s;
  long long n = s.size();
  vector<vector<long long>> acc(26, vector<long long>(n + 10, 0));
  vector<vector<long long>> racc(26, vector<long long>(n + 10, 0));
  for (long long i = (0); i < (long long)(n); i++) {
    for (long long j = (0); j < (long long)(26); j++) acc[j][i + 1] = acc[j][i];
    acc[s[i] - 'a'][i + 1]++;
  }
  reverse(s.begin(), s.end());
  for (long long i = (0); i < (long long)(n); i++) {
    for (long long j = (0); j < (long long)(26); j++)
      racc[j][i + 1] = racc[j][i];
    racc[s[i] - 'a'][i + 1]++;
  }
  reverse(s.begin(), s.end());
  auto query = [&]() {
    long long l, r;
    std::cin >> l >> r;
    if (r - l == 0) {
      cout << "Yes\n";
      return;
    }
    for (long long i = (0); i < (long long)(26); i++) {
      for (long long j = (0); j < (long long)(26); j++) {
        if (i == j) continue;
        if (s[l - 1] - 'a' == i || s[r - 1] - 'a' == j) continue;
        long long rl = n - l + 1;
        long long rr = n - r + 1;
        long long inum = acc[i][r] - acc[i][l - 1];
        long long jnum = racc[j][rl] - racc[j][rr - 1];
        if (inum == 0 || jnum == 0) continue;
        cout << "Yes\n";
        return;
      }
    }
    cout << "No\n";
    return;
  };
  long long q;
  std::cin >> q;
  for (long long qu = (0); qu < (long long)(q); qu++) query();
  return 0;
}
