#include<cstdio>
#include<cstring>
const int M=500009,INF=100000000;
int n,i,j,q,l,r,a[M],f[M][20],dp[M][30];
char s[M];

int read()
{
	int x=0; char ch=getchar();
	while (ch<48 || ch>57) ch=getchar();
	while (ch>=48 && ch<=57) x=(x<<1)+(x<<3)+ch-48,ch=getchar();
	return x;
}

int main()
{
	scanf("%s",s+1),n=strlen(s+1);
	for (i=1;i<=n;++i) a[i]=s[i]-96,dp[i][a[i]]=i;
	for (i=0;i<27;++i) dp[n+1][i]=INF;
	for (i=n;i;--i)
	{
		for (j=a[i]+1;j<27;++j)
			if (dp[i][j-1]>n) dp[i][j]=INF;
			else dp[i][j]=dp[dp[i][j-1]+1][j-1];
		if (dp[i][26]>n) dp[i][0]=INF;
		else dp[i][0]=dp[dp[i][26]+1][26];
		for (j=1;j<a[i];++j)
			if (dp[i][0]>n) dp[i][j]=INF;
			else dp[i][j]=dp[dp[i][0]+1][j];
		if (dp[i][0]>n) f[i][0]=INF;
		else f[i][0]=dp[i][0]+1;
	}
	for (f[n+1][0]=INF,i=1;i<19;++i)
		for (j=1;j<=n+1;++j)
			if (f[j][i-1]==INF) f[j][i]=INF;
			else f[j][i]=f[f[j][i-1]][i-1];
	for (q=read();q;--q)
	{
		l=read(),r=read();
		for (i=18;~i;--i)
			if (f[l][i]<r+2) l=f[l][i];
		if (l==r+1) puts("Yes"); else puts("No");
	}
	return 0;
}