#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base :: sync_with_stdio(false);

    //ifstream cin("testC.in");
    string a; cin >> a;
    int n = a.size();
    for(int i = 0; i < n; ++i)
        a[i] -= 'a';

    vector<vector<int>> nxt(n, vector<int> (27, n));
    
    for(int i = n - 1; i >= 0; --i) {
        nxt[i][a[i]] = i;
        for(int c = a[i] + 1; c < 27; ++c) {
            int self = nxt[i][c - 1] + 1;
            if(self >= n)
                continue;
            nxt[i][c] = nxt[self][c - 1];
        }

        for(int c = 0; c < 26; ++c) {
            if(nxt[i][26] + 1 < n)
                nxt[i][c] = min(nxt[i][c], nxt[nxt[i][26] + 1][c]);
        }   
    }
    
    vector<vector<int>> anc(21, vector<int> (n, 0));

    for(int i = 0; i < n; ++i)
        anc[0][i] = nxt[i][26];

    for(int lg = 1; lg < 21; ++lg) {
        for(int i = 0; i < n; ++i) {
            if(anc[lg - 1][i] >= n - 1) {
                anc[lg][i] = n;
            } else {
                anc[lg][i] = anc[lg - 1][anc[lg - 1][i] + 1];
            }
        }
    }
    
    int q; cin >> q;

    for(int i = 0; i < q; ++i) {
        int x, y; cin >> x >> y;
        x--, y--;
            
        bool good = false;
        int now = x;

        for(int lg = 20; lg >= 0; --lg) {
            if(anc[lg][now] <= y) {
                now = anc[lg][now] + 1;
                if(now == y + 1)
                    good = true;
            }
        }

        if(not good) {
            cout << "No\n";
        } else {
            cout << "Yes\n";
        }
    }
}