#include<vector>
#include<cmath>
#include<map>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<set>
#include<stack>
#include<bitset>
#include<functional>
#include<ctime>
#include<queue>
#include<deque>
#include<complex>
#include<cassert>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
int dp[30][512810];
int dbl[512810][30];
string s;int n;
int cal(int i,int j,int ne){
	if(dp[i][j]>ne){
		dp[i][j]=ne;return 1;
	}
	return 0;
}
int main()
{
	int q,x,y,inf=512810;
	cin>>s;
	n=s.size();
	//memset(dp,-1,sizeof(dp));memset(dbl,-1,sizeof(dbl));
	rep(i,30) rep(j,inf-10) dp[i][j]=dbl[j][i]=inf;
	for(int j=n-1;j>=0;j--){
		rep(k,2){
			int f=0;
			rep(i,27){
				if(s[j]==('a'+i)){
					f|=cal(i,j,j+1);//dp[i][j]=j+1;
				}
				if(i>0 && dp[i-1][j]<inf){
					f|=cal(i,j,dp[i-1][dp[i-1][j]]);//dp[i][j]=min(dp[i-1][dp[i-1][j]],dp[i][j]);
				}
				if(i<26 && dp[26][j]<inf){
					f|=cal(i,j,dp[i][dp[26][j]]);//dp[i][j]=min(dp[i][dp[26][j]],dp[i][j]);
				}
				//if(dp[i][j+1]>=0) cout<<i<<' '<<j+1<<' '<<dp[i][j+1]<<endl;
			}
			//if(f<1) break;
		}
	}
	rep(i,n+10){
		dbl[i][0]=dp[26][i];
		//if(i<=n) cout<<i<<' '<<dp[26][i]<<endl;
	}
	rep(i,26) rep(j,n+10){
		if(dbl[j][i]<inf) dbl[j][i+1]=dbl[dbl[j][i]][i];
		//if(i<4 && j<=n) cout<<i<<' '<<j<<' '<<dbl[j][i]<<endl;
	}
	cin>>q;
	rep(i,q){
		cin>>x>>y;x--;
		for(int i=22;i>=0;i--){
			if(dbl[x][i]<=y) x=dbl[x][i];
			//cout<<x<<endl;
		}
		if(y==x) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
}
