#include <iostream>
#include <vector>
#include <string>
#include <cstring>

using namespace std;

int dp[500000][26];
int z[500000][20];

void makeTable(const string& s){
	int n = s.size();
	memset(dp, -1, sizeof(dp));
	memset(z, -1, sizeof(z));
	for(int i=n-1;i>=0;i--){
		dp[i][s[i]-'a'] = i+1;
		int dst = i+1;
		for(int j=s[i]-'a'+1;j<26;j++){
			if(dst < n && dp[dst][j-1] != -1){
				dp[i][j] = dp[dst][j-1];
				dst = dp[dst][j-1];
			} else {
				break;
			}
		}
		if(dp[i][25] != -1 && dst < n && dp[dst][25] != -1 && dp[dst][25] < n){
			dst = dp[dst][25];
			if(dst < n){
				for(int j=0;j<s[i]-'a';j++) dp[i][j] = dp[dst][j];
			}
		}
		// cout << i << ":";
		// for(int j=0;j<26;j++) cout << dp[i][j] << " ";
		// cout << endl;
	}
	for(int i=n-1;i>=0;--i){
		if(dp[i][25] != -1){
			z[i][0] = dp[i][25];
			int c = 1;
			int dst = dp[i][25];
			while(dst < n && z[dst][c-1] != -1){
				z[i][c] = z[dst][c-1];
				dst = z[i][c];
				++c;
			}
		}
		// cout << i << ":";
		// for(int j=0;j<z[i].size();j++) cout << z[i][j] << " "; cout << endl;
	}
}

string query(int l, int r){
	int chk = 19;
	while(chk > 0){
		while(chk >= 0 && z[l][chk] == -1) --chk;
		if(chk <= 0) return "No";
		while(chk >= 0 && z[l][chk] > r) --chk;
		if(chk <= 0) return "No";
		if(z[l][chk] == r) return "Yes";
		l = z[l][chk];
	}
	return chk > 0 ? "Yes" : "No";
}

int main(){
	string s;
	while(cin >> s){
		makeTable(s);
		int Q; cin >> Q;
		for(int i=0;i<Q;i++){
			int l, r; cin >> l >> r;
			--l;
			cout << query(l, r) << endl;
		}
	}
}
