//bcw0x1bd2 {{{
#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);
#define SZ(x) ((int)((x).size()))
#define ALL(x) begin(x),end(x)
#define REP(i,x) for (int i=0; i<(x); i++)
#define REP1(i,a,b) for (int i=(a); i<=(b); i++)

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef long double ld;

#ifdef DARKHH
#define FILEIO(name)
#else
#define FILEIO(name) \
  freopen(name".in", "r", stdin); \
  freopen(name".out", "w", stdout);
#endif

#ifdef DARKHH
template<typename T>
void _dump( const char* s, T&& head ) { cerr<<s<<"="<<head<<endl; }

template<typename T, typename... Args>
void _dump( const char* s, T&& head, Args&&... tail ) {
  int c=0;
  while ( *s!=',' || c!=0 ) {
    if ( *s=='(' || *s=='[' || *s=='{' ) c++;
    if ( *s==')' || *s==']' || *s=='}' ) c--;
    cerr<<*s++;
  }
  cerr<<"="<<head<<", ";
  _dump(s+1,tail...);
}

#define dump(...) do { \
  fprintf(stderr, "%s:%d - ", __PRETTY_FUNCTION__, __LINE__); \
  _dump(#__VA_ARGS__, __VA_ARGS__); \
} while (0)

template<typename Iter>
ostream& _out( ostream &s, Iter b, Iter e ) {
  s<<"[";
  for ( auto it=b; it!=e; it++ ) s<<(it==b?"":" ")<<*it;
  s<<"]";
  return s;
}

template<typename A, typename B>
ostream& operator <<( ostream &s, const pair<A,B> &p ) { return s<<"("<<p.first<<","<<p.second<<")"; }
template<typename T>
ostream& operator <<( ostream &s, const vector<T> &c ) { return _out(s,ALL(c)); }
template<typename T, size_t N>
ostream& operator <<( ostream &s, const array<T,N> &c ) { return _out(s,ALL(c)); }
template<typename T>
ostream& operator <<( ostream &s, const set<T> &c ) { return _out(s,ALL(c)); }
template<typename A, typename B>
ostream& operator <<( ostream &s, const map<A,B> &c ) { return _out(s,ALL(c)); }
#else
#define dump(...)
#endif
// }}}
// Let's Fight! ~OAO~~

const int LOG = 22;
const int MXN = 500005;
const int INf = 1029384756;

int N,ip[MXN];
int dp[MXN][27];
int ed[MXN];
int nxt[LOG][MXN];
string S;

int go(int i, int c) {
  if (i >= N) return N;
  int &res = dp[i][c];
  assert(res != -1);
  return res;
}

int main() {
  IOS;
  cin>>S;
  N = SZ(S);
  REP(i,N) ip[i] = S[i]-'a';

  memset(dp,-1,sizeof(dp));
  for (int i=N-1; i>=0; i--) {
    REP(c,26) {
      int &res = dp[i][c];
      if (c >= ip[i]) {
        int j = i;
        REP1(x,ip[i]+1,c) {
          j++;
          j = go(j,x-1);
        }
        res = j;
      } else {
        int j = i+1;
        REP1(x,ip[i],25) {
          j = go(j,x);
          j++;
        }
        res = go(j,c);
      }
    }
  }
  REP(i,N) {
    int j = go(i,25);
    int k = go(j+1,25);
    ed[i] = k;
    //dump(i,ed[i]);
  }

  REP(i,N) nxt[0][i] = ed[i];
  ed[N] = N;

  REP(i,LOG) nxt[i][N] = N;

  REP1(i,1,LOG-1) {
    REP(j,N) {
      nxt[i][j] = nxt[i-1][min(N,nxt[i-1][j]+1)];
    }
  }

  int Q;
  cin>>Q;
  REP(q,Q) {
    int l,r;
    cin>>l>>r;

    l--;
    r--;

    for (int i=LOG-1; i>=0; i--) {
      if (nxt[i][l]+1 <= r) l = nxt[i][l]+1;
    }

    if (nxt[0][l] == r) cout<<"Yes\n";
    else cout<<"No\n";

  }

  return 0;
}



Measured memory_bytes: 100892