#include<bits/stdc++.h>

using namespace std;

const int MAXN = 500005;
const int LOG = 20;

int n, q;
string s;
int dp[26][MAXN], p[MAXN], par[LOG][MAXN];

void precompute () {
    for (int i = 1; i <= n; i++) {
        if (p[i - 1] == n) par[0][i] = 0; else par[0][i] = p[i - 1] + 2;
    }
    for (int i = 1; i < LOG; i++) {
        for (int j = 1; j <= n; j++) {
            par[i][j] = par[i - 1][par[i - 1][j]];
        }
    }
}

bool upit (int x, int y) {
    for (int i = LOG - 1; i >= 0; i--) {
        if (par[i][x] != 0 && par[i][x] <= y) x = par[i][x];
    }
    return x == y;
}

int main () {
    cin >> s;
    n = s.size();
    for (int j = 0; j < 26; j++) dp[j][n] = n; p[n] = n;

    for (int i = n-1; i >= 0; i--) {
        int c = s[i] - 'a', curr = i;
        for (; c < 26; c++) {
            curr = dp[c][min(curr + 1, n)];
        }
        p[i] = curr;

        for (int j = 0; j < 26; j++) {
            int res = n;
            if (j - 1 >= 0) res = min(res, dp[j - 1][min(dp[j - 1][i] + 1, n)]);
            res = min(res, dp[j][min(p[i] + 1, n)]);
            if (s[i] - 'a' == j) res = min(res, i);
            dp[j][i] = res;
        }
    }
    precompute();
    cin >> q;
    for (int i = 0; i < q; i++) {
        int a, b;
        cin >> a >> b;
        if (upit(a, b + 1)) cout << "Yes\n"; else cout << "No\n";
    }
    return 0;
}
