#include<bits/stdc++.h>

using namespace std;

int nr, N, M, leftEnd[500009], rightEnd[500009], t[500009], first[500009][26];
char s[500009];
vector < int > v[500009];

void dfs (int nod)
{
    leftEnd[nod] = ++nr;
    for (auto it : v[nod])
        dfs (it);
    rightEnd[nod] = nr;
}

bool isAncestor (int up, int down)
{
    return (leftEnd[up] <= leftEnd[down] && leftEnd[down] <= rightEnd[up]);
}

int main ()
{
//freopen ("input", "r", stdin);
//freopen ("output", "w", stdout);

scanf ("%s", s + 1), N = strlen (s + 1);
for (int i=1; i<=N; i++)
    s[i] -= 'a';
for (int i=N; i>=1; i--)
{
    int c = s[i];
    t[i] = -1, first[i][s[i]] = i;
    for (int j=i + 1; j<=N; j++)
    {
        if (s[j] == c)
        {
            if (c == 25)
            {
                t[i] = j + 1;
                break;
            }
            c ++, first[i][c] = j;
        }
        else
        {
            j = first[j][c];
            if (j <= 0) break;
            if (c == 25)
            {
                t[i] = j + 1;
                break;
            }
            c ++, first[i][c] = j;
        }
    }
    if (t[i] != -1)
    {
        for (int j=0; j<26; j++)
            if (first[i][j] <= 0)
                first[i][j] = first[t[i]][j];
    }
}
for (int i=1; i<=N; i++)
    if (t[i] != -1)
        v[t[i]].push_back (i);
for (int i=1; i<=N + 1; i++)
    if (t[i] == -1 || i == N + 1)
        dfs (i);
scanf ("%d", &M);
while (M --)
{
    int x, y;
    scanf ("%d %d", &x, &y);
    if (isAncestor (y + 1, x)) printf ("Yes\n");
    else printf ("No\n");
}
return 0;
}
