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

const int N = 5e5 + 5, Sigma = 27, bzmax = 20; 

int n, q;
char s[N];
int nxt[N][Sigma], bz[N][bzmax];

int main() {
	scanf("%s", s + 1);
	n = strlen(s + 1);
	scanf("%d", &q);
	fill(nxt[n + 1], nxt[n + 1] + Sigma, N);
	fill(bz[n + 1], bz[n + 1] + bzmax, N);
	for (int i = n; i; i--) {
		int c = s[i] - 'a';
		nxt[i][c] = i + 1;
		for (int j = c + 1; j < Sigma; j++) {
			nxt[i][j] = nxt[i][j - 1] == N ? N : nxt[nxt[i][j - 1]][j - 1];	
		}
		int p = nxt[i][26];
		for (int j = c; j--; ) {
			nxt[i][j] = p == N ? N : nxt[p][j];
		}
		bz[i][0] = p;
		for (int j = 1; j < bzmax; j++) {
			bz[i][j] = bz[i][j - 1] == N ? N : bz[bz[i][j - 1]][j - 1];
		}
	}
	int l, r;
	while (q--) {
		scanf("%d%d", &l, &r);
		++r;
		for (int i = bzmax; i--; ) {
			if (bz[l][i] <= r) {
				l = bz[l][i];
			}
		}
		puts(l == r ? "Yes" : "No");
	}
	return 0;
}
