#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Vi = vector<int>;
using Pii = pair<int, int>;
int uplg(int n) { return 32 - __builtin_clz(n); }
int uplg(ll n) { return 64 - __builtin_clzll(n); }
void run();
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(18);
  run();
  return 0;
}
string s;
Vi prefs[26];
void run() {
  cin >> s;
  int q;
  cin >> q;
  for (int c = (0); c < (26); c++) {
    prefs[c].push_back(0);
    for (int i = (0); i < (int((s).size())); i++) {
      prefs[c].push_back(prefs[c].back() + (s[i] - 'a' == c));
    }
  }
  for (int t = (0); t < (q); t++) {
    int l, r;
    cin >> l >> r;
    l--;
    bool ok = (r - l <= 1 || s[l] != s[r - 1]);
    if (!ok) {
      int cnt = 0;
      for (int i = (0); i < (26); i++) {
        cnt += prefs[i][r] - prefs[i][l] > 0;
      }
      ok = (cnt >= 3);
    }
    cout << (ok ? "Yes\n" : "No\n");
  }
}
