#include <bits/stdc++.h>
using namespace std;
long long t = 1;
template <class myType>
void print_arr(myType &arr, long long L, string sep) {
  for (long long(i) = (0); (i) < (L); ++(i)) {
    cout << arr[i];
    if (i < L - 1) {
      cout << sep;
    }
  }
  cout << "\n";
  return;
}
void solve() {
  string S;
  cin >> S;
  int n = S.size();
  int q;
  cin >> q;
  long long prefs[n + 1][26];
  for (long long(i) = (0); (i) < (n + 1); ++(i))
    for (long long(j) = (0); (j) < (26); ++(j)) prefs[i][j] = 0;
  for (int i = 1; i <= n; i++) {
    for (long long(j) = (0); (j) < (26); ++(j)) {
      prefs[i][j] += prefs[i - 1][j];
    }
    prefs[i][S[i - 1] - 'a']++;
  }
  for (long long(i) = (0); (i) < (q); ++(i)) {
    int l, r;
    cin >> l >> r;
    l--;
    r--;
    int num = 0;
    for (long long(j) = (0); (j) < (26); ++(j)) {
      if (prefs[r + 1][j] - prefs[l][j] > 0) {
        num++;
      }
    }
    if (l != r && S[l] == S[r] && num <= 2) {
      cout << "No"
           << "\n";
    } else {
      cout << "Yes"
           << "\n";
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  while (t--) solve();
  return 0;
}
