#include <bits/stdc++.h>
using namespace std;
const int MAXN = 30;
vector<int> pos[MAXN];
string inp;
int countdiff(int l, int r) {
  int res = 0;
  for (int i = 0; i < 26; i++) {
    auto it = lower_bound(pos[i].begin(), pos[i].end(), l);
    if (it != pos[i].end() && *it <= r) res++;
  }
  return res;
}
int main() {
  ios::sync_with_stdio((false));
  cin >> inp;
  for (int i = 0; i < inp.size(); i++) {
    pos[inp[i] - 'a'].push_back(i);
  }
  int qlen;
  cin >> qlen;
  while (qlen--) {
    int l, r;
    cin >> l >> r;
    l--, r--;
    int diff = countdiff(l, r);
    if (l == r || diff >= 3 || (diff == 2 && inp[l] != inp[r])) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  }
}
