#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
char s[600001];
int i,j,k,n,m,f[600001][27],g[600001][21];
void build(){
	int i,j;
	for (i=0;i<=20;i++) g[n+1][i]=g[n+2][i]=n+1;
	for (i=n;i;i--)
	 for (j=1,g[i][0]=f[i][0];j<=20;j++) g[i][j]=g[g[i][j-1]+1][j-1];
}
bool query(int x,int v){
	int i;
	x--;
	for (i=20;x<v;x=g[x][i])
	 for (x++;i&&g[x][i]>v;i--);
	return x==v;
}
int main(){
	scanf("%s",s);n=strlen(s);
	for (i=0;i<=26;i++) f[n+1][i]=f[n+2][i]=n+1;
	for (i=n;i;i--){
		k=s[i-1]-'a'+1;f[i][k]=i;
		for (j=k+1;j<=26;j++) f[i][j]=f[f[i][j-1]+1][j-1];
		f[i][0]=f[f[i][26]+1][26];
		for (j=1;j<k;j++) f[i][j]=f[f[i][0]+1][j];
	}
	build();
	scanf("%d",&m);
	for (i=1;i<=m;i++){
		scanf("%d%d",&j,&k);
		puts((query(j,k))?"Yes":"No");
	}
	return 0;
}