#include <stdio.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
#include <set>
using namespace std;


int main()
{
	string str;
	cin >> str;
	int N = str.length();
	int n = N, levels = 1;
	while ((n >>= 1) > 0)
		levels++;

	vector<vector<int>> next(N + 2, vector<int>(27, N+1));
	vector<vector<int>> lev(levels, vector<int>(N+2));

	for (int i = N - 1; i >= 0; --i)
	{
		char c = str[i] - 97;
		int prev = next[i][c] = i + 1;
		for (int j = c+1; j < 27 && prev < N; j++)
			prev = next[i][j] = next[prev][j - 1];

		if (prev < N)
			for (int j = 0; j < c; j++)
				next[i][j] = next[prev][j];

		lev[0][i] = next[i][26];
	}
	lev[0][N+1] = lev[0][N] = N + 1;

	for (int i = 1; i < levels; ++i)
		for (int j = 0; j<N+2; ++j)
			lev[i][j] = lev[i-1][lev[i-1][j]];

	int Q;
	cin >> Q;
	for (int i = 0; i < Q; i++)
	{
		int l, r;
		cin >> l >> r;

		l--;
		int lvl = levels - 1;
		while (l < r)
		{
			while (lev[lvl][l] > r && lvl > 0)
				lvl--;
			l = lev[lvl][l];
		}

		if (l == r)
			cout << "Yes\n";
		else
			cout << "No\n";
	}
	return 0;
}