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

#define forn(i,n) for(int i=0;i<(int)(n);i++)
#define si(c) ((int)(c).size())
#define forsn(i,s,n) for(int i = (int)(s); i<((int)n); i++)
#define dforsn(i,s,n) for(int i = (int)(n)-1; i>=((int)s); i--)
#define all(c) (c).begin(), (c).end()
#define D(a) cerr << #a << "=" << a << endl;
#define pb push_back
#define eb emplace_back
#define mp make_pair

typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;

const int N = 5e5 + 100;
const int SZ = 30;

int n, jump[N][SZ];
string s;

int d[N], f[N], t;
vi adj[N];
void dfs(int u, int p) {
    d[u] = t++;
    for (int v : adj[u]) if (v != p) dfs(v,u);
    f[u] = t;
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

    cin >> s; n = si(s);
    for (char &c : s) c -= 'a';

    forn(c,27) {
        jump[n+1][c] = n+1;
        jump[n][c] = n+1;
    }

    dforsn(i,0,n) {
        forn(c,27) {
            if (c < s[i]) jump[i][c] = n+1;
            else if (c == s[i]) jump[i][c] = i+1;
            else jump[i][c] = jump[jump[i][c-1]][c-1];
        }
        if (jump[i][26] < n+1) {
            forn(c,27) jump[i][c] = min(jump[i][c], jump[jump[i][26]][c]);
        }
    }

    //forn(i,n+1) cerr << i << ' ' << jump[i][26] << endl;

    forn(i,n+1) adj[jump[i][26]].pb(i);
    dfs(n+1,-1);

    int q; cin >> q;
    while (q--) {
        int l,r; cin >> l >> r;
        l--;
        bool ans = (d[r] <= d[l] && f[l] <= f[r]);
        cout << (ans ? "Yes\n" : "No\n");
    }

    return 0;
}
