#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>

char s[524288];
int a[524288];
int n;
int f[524288][27];
int e[524288][20];

int main() {
    //freopen("C.in", "r", stdin);
    scanf("%s", s);
    n = strlen(s);
    memset(f, -1, sizeof(f));
    memset(e, -1, sizeof(e));
    for (int i = n - 1; i >= 0; --i) {
        a[i] = s[i] - 97;
        int fnow = i;
        int now = a[i];
        f[i][a[i]] = i;
        for (int j = a[i] + 1; j < 27; ++j) {
            f[i][j] = f[f[i][j - 1] + 1][j - 1];
            if (f[i][j] == -1)
                break;
        }
        if (f[i][26] > -1) {
            e[i][0] = f[i][26];
            for (int j = 0; j < a[i]; ++j)
                f[i][j] = f[f[i][26] + 1][j];
        }
    }
    for (int j = 1; j < 20; ++j)
        for (int i = 0; i < n; ++i)
            if (e[i][j - 1] > -1)
                e[i][j] = e[e[i][j - 1] + 1][j - 1];
    int Q;
    scanf("%d", &Q);
    while (Q--) {
        int l, r;
        scanf("%d%d", &l, &r);
        --l;
        --r;
        for (int i = 19; i >= 0; --i)
            if (e[l][i] > -1 && e[l][i] <= r)
                l = e[l][i] + 1;
        if (l == r + 1)
            printf("Yes\n");
        else
            printf("No\n");
    }
    return 0;
}