#include <bits/stdc++.h>
#define xx first
#define yy second
#define mp make_pair
#define pb push_back
#define fill(x, y) memset(x, y, sizeof x)
#define copy(x, y) memcpy(x, y, sizeof x)
using namespace std;

typedef long long LL;
typedef pair < int, int > pa;

inline int read()
{
	int sc = 0, f = 1; char ch = getchar();
	while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
	while (ch >= '0' && ch <= '9') sc = sc * 10 + ch - '0', ch = getchar();
	return sc * f;
}

const int MAXN = 500005;

int n, Q, f[MAXN][26], g[19][MAXN];
char s[MAXN];

inline void init()
{
	for (int i = 0; i < 26; i ++) f[n + 1][i] = f[n + 2][i] = n + 2;
	g[0][n + 1] = g[0][n + 2] = n + 2; 
	for (int i = n; i; i --)
	{
		f[i][s[i] - 'a'] = i + 1;
		for (int j = s[i] - 'a' + 1; j < 26; j ++) f[i][j] = f[f[i][j - 1]][j - 1];
		g[0][i] = f[f[i][25]][25];
		for (int j = 0; j < s[i] - 'a'; j ++) f[i][j] = f[g[0][i]][j];
	}
	for (int j = 1; j <= 18; j ++)
		for (int i = 1; i <= n + 2; i ++)
			g[j][i] = g[j - 1][g[j - 1][i]];
}

int main()
{
#ifdef wxh010910
	freopen("data.in", "r", stdin);
#endif
	scanf("%s", s + 1); n = strlen(s + 1);
	init();
	for (Q = read(); Q; Q --)
	{
		int l = read(), r = read();
		for (int i = 18; ~i; i --) if (g[i][l] <= r + 1) l = g[i][l];
		puts(l == r + 1 ? "Yes" : "No");
	}
}
