#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <climits>
#include <sstream>
#include <functional>
#include <complex>
#include <cassert>

using namespace std;

#define len(array)  (sizeof (array) / sizeof *(array))
#define rep(i, s, e) for(int i = (s);i < (e);i++)
#define Rep(i, e) for(int i = 0;i < (e);i++)
#define rrep(i, e, s) for(int i = (e);(s) <= i;i--)
#define Rrep(i, e) for(int i = e;0 <= i;i--)
#define maprep(i, e, t1, t2) for(map<t1, t2>::iterator i = e.begin(); i != e.end(); i++)
#define setrep(i, e, t) for(set<t>::iterator i = e.begin(); i != e.end(); i++)
#define vrange(v) v.begin(), v.end()
#define vrrange(v) v.rbegin(), v.rend()
#define vsort(v) sort(vrange(v))
#define vrsort(v) sort(vrrange(v))
#define arange(a) a, a + len(a)
#define asort(a) sort(arange(a))
#define arsort(a, t) sort(arange(a), greater<t>())
#define afill(a, v) fill(arange(a), v)
#define fabs(a) ((a) < 0? -(a) : (a))
#define pb push_back
#define fst(e) (e).first
#define snd(e) (e).second
#define rg(e, s, t) (s <= e && e < t)
#define PQDecl(name, tp) priority_queue< tp, vector<tp>, greater<tp> > name
#define dq(q) q.top();q.pop();
#define sz(v) ((int)(v).size())
#define lg(s) ((int)(s).length())
//#define X real()
//#define Y imag()
//typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
typedef vector<int> VI;
//typedef complex<double> p;
const int INF = (int)2e9;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-10;

#define MAX_N 500005
#define MAX_ALPHA 26
#define MAX_EXP 20

string s;
int q, qLeft, qRight;
int _next[MAX_N];
int _nextC[MAX_N][MAX_ALPHA];
int _next2Exp[MAX_N][MAX_EXP];

int next(int l);

// s[l]から文字列がcになる一番小さいr
int nextC(int l, int c) {
  if (l >= s.length()) {
    return INF;
  }

  int result = INF;
  int currentCode = s[l] - 'a';

  if (_nextC[l][c] == 0) {
    if (currentCode == c) {
      result = min(l, result);
    }
    else if (currentCode < c) {
        int tmp = nextC(l, c - 1);
        if (tmp < s.length()) {
          result = nextC(tmp + 1, c - 1);
        }
    }
    else {
      int tmp = next(l);
      if (tmp < s.length()) {
        result = nextC(tmp + 1, c);
      }
    }

    // printf("nextC(%d, %c) = %d\n", l, (char)(c + 'a'), result);
    _nextC[l][c] = result + 1;
  }

  return _nextC[l][c] - 1;
}

// s[l]から文字列が空になる一番小さいr
int next(int l) {
  if (l >= s.length()) {
    return INF;
  }

  int result = INF;
  if (_next[l] == 0) {
    int tmp = nextC(l, 'z' - 'a');
    if (tmp < s.length()) {
      result = nextC(tmp + 1, 'z' - 'a');
    }

    _next[l] = result + 1;
    // printf("next(%d) = %d\n", l, result);
  }

  return _next[l] - 1;
}

// next^{2^exp}(l)を求める
int next2Exp(int l, int exp) {
  if (l >= s.length()) {
    return INF;
  }
  // printf("next2Exp(%d, %d) invoked.\n", l, exp);

  int result = INF;
  if (_next2Exp[l][exp] == 0) {
    if (exp == 0) {
      result = next(l);
    }
    else {
      int tmp = next2Exp(l, exp - 1);
      if (tmp < s.length()) {
        result = next2Exp(tmp + 1, exp - 1);
      }
    }

    _next2Exp[l][exp] = result + 1;
  }
  // printf("2: next2Exp(%d, %d) = %d, memo = %d\n", l, exp, result, _next2Exp[l][exp]);


  return _next2Exp[l][exp] - 1;

}

// s[l..r]で文字列は空になるか
bool judge(int l, int r) {
  int index = l;
  for (int i = MAX_EXP - 1; i >= 0 ; i--){
    int tmp = next2Exp(index, i);

    if (tmp == r) {
      return true;
    }
    else if (tmp > r) {
      continue;
    }

    // printf("judge(%d, %d): loop %d -> next2Exp(%d, %d) = %d\n", l, r, i, index, i, tmp);

    index = tmp + 1;
  }

  return false;
}

void solve(){
  cin >> s;

  scanf("%d", &q);


  for (int i = 0; i < q; i++){
    scanf("%d%d", &qLeft, &qRight);

    cout << (judge(qLeft - 1, qRight - 1) ? "Yes" : "No") << endl;
  }
}

void doIt(){
  int t = 1;
  // scanf("%d", &t);
  while(t--){
    solve();
  }
}

void test() {
  s = "yzyyyzyzyyyz";

  nextC(7, 'y' - 'a');
  // for (int i = 0; i < s.length(); i++){
  //   printf("next2Exp(%d, 0) = %d\n", i, next2Exp(1, 0));
  // }
}

int main() {
  // test();
  doIt();
  return 0;
}


Measured memory_bytes: 233860