#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int main() {
  string s;
  cin >> s;
  set<int> change;
  map<char, set<int>> posCh;
  for (int i = 1; i < s.size(); ++i) {
    if (s[i - 1] != s[i]) {
      change.insert(i);
      posCh[s[i]].insert(i);
    }
  }
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    --l;
    --r;
    if (l == r)
      cout << "Yes\n";
    else {
      auto itCh = change.upper_bound(l);
      if (itCh != change.end() && *itCh <= r) {
        bool flag = 0;
        if (s[l] == s[r]) {
          for (auto it = posCh.begin(); it != posCh.end(); ++it) {
            if ((*it).first != s[l] && (*it).first != s[*itCh]) {
              auto next = (*it).second.upper_bound(l);
              if (next != (*it).second.end() && *next <= r) {
                flag = 1;
                break;
              }
            }
          }
          if (!flag) {
            cout << "No\n";
            continue;
          }
        }
        cout << "Yes\n";
      } else
        cout << "No\n";
    }
  }
}
