#include<iostream>
#include<cstdio>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cassert>
#define PB push_back
#define MP make_pair
#define sz(v) (in((v).size()))
#define forn(i,n) for(in i=0;i<(n);++i)
#define forv(i,v) forn(i,sz(v))
#define fors(i,s) for(auto i=(s).begin();i!=(s).end();++i)
#define all(v) (v).begin(),(v).end()
using namespace std;
typedef long long in;
typedef vector<in> VI;
typedef vector<VI> VVI;
const in asz=26;
const in mx=500009;
in fst[mx][asz+1];
string s;
in n;
in nxte[mx][22];
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin>>s;
  n=sz(s);
  forn(i,asz+1)
    fst[n][i]=n;
  for(in i=n-1;i>=0;--i){
    forn(j,asz+1)
      fst[i][j]=n;
    fst[i][s[i]-'a']=i;
    in u=i+1;
    in cr=s[i]-'a';
    while(u<n && cr<asz){
      fst[i][cr+1]=fst[u][cr];
      u=fst[i][cr+1]+1;
      ++cr;
    }
    if(fst[i][asz]<n){
      for(in j=0;fst[i][j]==n;++j)
	fst[i][j]=fst[fst[i][asz]+1][j];
    }
  }
  forn(i,n)
    nxte[i][0]=fst[i][asz];
  forn(j,22)
    nxte[n][j]=nxte[n+1][j]=n;
  for(in i=n-1;i>=0;--i){
    for(in j=1;j<22;++j)
      nxte[i][j]=nxte[nxte[i][j-1]+1][j-1];
  }
  in q;
  cin>>q;
  in l,r;
  forn(zz,q){
    cin>>l>>r;
    --l;
    --r;
    in cu=21;
    while(cu>=0){
      if(nxte[l][cu]<=r)
	l=nxte[l][cu]+1;
      --cu;
    }
    if(nxte[l][0]<=r)
      l=nxte[l][0]+1;
    if(l==r+1)
      cout<<"Yes\n";
    else
      cout<<"No\n";
  }
  return 0;
}
