#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <bitset>

using namespace std;
typedef pair<int, int> Pi;
typedef long long ll;
#define pii Pi
#define pll PL
#define Fi first
#define Se second
#define pb(x) push_back(x)
#define sz(x) ((int)(x).size())
#define rep(i, n) for(int i=0;i<n;i++)
#define all(x) (x).begin(), (x).end()
typedef tuple<int, int, int> t3;
typedef pair<ll, ll> PL;

int A[500050];
char temp[500050];
t3 Q[500050];
int D[500050][27];
int ans[500050];

int up[500050][20];

void solve(){
	scanf("%s", temp+1);
	int n = (int)strlen(temp + 1);
	for(int i=1;i<=n;i++)A[i] = temp[i] - 'a';
	int q; scanf("%d", &q);
	rep(i, 27)D[n+1][i] = -1;
	for(int i=n;i;i--){
		int c = A[i];
		int pp = i;
		for(int j=c;j<26;j++){
			if(D[pp+1][j] != -1)pp = D[pp+1][j];
			else{ pp = -1; break; }
		}
		if(pp == -1)rep(j, c)D[i][j] = -1;
		else rep(j, c)D[i][j] = D[pp+1][j];
		D[i][c] = i;
		for(int j=c+1;j<=26;j++)D[i][j] = -1;
		for(int j=c, x=i+1;j<26;j++){
			int y = D[x][j];
			if(y == -1)break;
			D[i][j+1] = y;
			x = y + 1;
		}
		if(D[i][26] == -1)up[i][0] = -1;
		else up[i][0] = D[i][26] + 1;
	}
	rep(j, 20)up[n+1][j] = -1;
	
	for(int j=1;j<20;j++){
		for(int i=1;i<=n;i++){
			if(up[i][j-1] == -1)up[i][j] = -1;
			else up[i][j] = up[ up[i][j-1] ][j-1];
		}
	}
	
	rep(i, q){
		int l, r; scanf("%d%d", &l, &r);
		int ans = 0;
		for(int j=19;j>=0;j--){
			if(up[l][j] == -1)continue;
			if(up[l][j] == r+1){ans = 1; break;}
			if(up[l][j] < r+1)l = up[l][j];
		}
		printf("%s\n", ans ? "Yes" : "No");
	}
}

int main(){
	int Tc = 1; //scanf("%d", &Tc);
	for(int tc=1;tc<=Tc;tc++){
		//printf("Case #%d: ", tc);
		solve();
	}
	return 0;
}