#include<bits/stdc++.h>
#define N 500005
using namespace std;

int n,a[N],f[N][26],g[N][19]; char s[N];
int main(){
	scanf("%s",s+1); n=strlen(s+1);
	int i,j;
	for (i=1; i<=n; i++) a[i]=s[i]-'a';
	for (i=0; i<=25; i++) f[n+1][i]=f[n+2][i]=n+2;
	for (i=0; i<=18; i++) g[n+1][i]=g[n+2][i]=n+2;
	for (i=n; i; i--){
		f[i][a[i]]=i+1;
		for (j=a[i]+1; j<26; j++) f[i][j]=f[f[i][j-1]][j-1];
		g[i][0]=f[f[i][25]][25];
		for (j=1; j<=18; j++) g[i][j]=g[g[i][j-1]][j-1];
		for (j=0; j<a[i]; j++) f[i][j]=f[g[i][0]][j];
	}
	int cas,l,r; scanf("%d",&cas);
	while (cas--){
		scanf("%d%d",&l,&r); r++;
		for (i=18; i>=0; i--) if (g[l][i]<=r) l=g[l][i];
		puts((l==r)?"Yes":"No");
	}
	return 0;
}
