/*#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/
#include<bits/stdc++.h>
#define ll long long
#define N 500005
#define inf 1000000005
#define mod 1000000007
#define put putchar('\n')
#define F(i,a,b) for (int i=(a);i<=(b);i++)
#define D(i,a,b) for (int i=(a);i>=(b);i--)
#define go(i,t) for (int i=head[t];i;i=Next[i])
#define sqr(x) ((x)*(x))
#define re register
#define mp make_pair
#define fi first
#define se second
using namespace std;
inline int read(){char c=getchar();int tot=1;while ((c<'0'|| c>'9')&&c!='-') c=getchar();if (c=='-'){tot=-1;c=getchar();}
int sum=0;while (c>='0'&&c<='9'){sum=sum*10+c-'0';c=getchar();}return sum*tot;}
inline void wr(int x){if (x<0) {putchar('-');wr(-x);return;}if(x>=10)wr(x/10);putchar(x%10+'0');}
inline void wrn(int x){wr(x);put;}inline void wri(int x){wr(x);putchar(' ');}
inline void wrn(int x,int y){wri(x);wrn(y);}inline void wrn(int a,int b,int c){wri(a);wrn(b,c);}
int n,m,k,f[N][27],g[N][21],a[N],x,y;
char str[N];
void pre(){
	F(i,1,n+2){
		F(j,0,26) f[i][j]=n+2;
		F(j,0,20) g[i][j]=n+2;
	}
	D(i,n,1){
		f[i][a[i]]=i+1;
		F(j,a[i]+1,26) f[i][j]=f[f[i][j-1]][j-1];
		g[i][0]=f[i][26];
		F(j,1,20) g[i][j]=g[g[i][j-1]][j-1];
		F(j,0,25) if (f[i][j]==n+2) f[i][j]=f[g[i][0]][j];
	}
}
bool solve(int x,int y){
	D(i,20,0){
		if (g[x][i]==y+1) return 1;
		if (g[x][i]<y) x=g[x][i];
	}
	return 0;
}
signed main(){
	//freopen("fusion.in","r",stdin);
	//freopen("fusion.out","w",stdout);
	scanf("%s",str+1);
	n=strlen(str+1);
	F(i,1,n) a[i]=str[i]-'a';
	pre();
	m=read();
	F(i,1,m){
		x=read();y=read();
		if (solve(x,y)) puts("Yes");
		else puts("No");
	}
	return 0;
}