#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 998244353;
const ll INF = (1e+18)+7;
typedef pair<int, int>P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-6;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

using mat = pair<LP, LP>;
void debug(vec &v) {
	int n = v.size();
	rep(i, n) {
		if (i > 0)cout << " ";
		cout << v[i];
	}
	cout << endl;
}


ll mod_pow(ll a, ll n) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%mod;
		a = a * a%mod; n >>= 1;
	}
	return res;
}


struct perm {
private:
	int sz;
	vector<ll> p, invp;
public:
	perm(int n) {
		sz = n + 1;
		p.resize(sz), invp.resize(sz);
		p[0] = 1;
		rep1(i, sz - 1) {
			p[i] = p[i - 1] * i%mod;
		}
		invp[sz - 1] = 1;
		ll cop = mod - 2, x = p[sz - 1];
		while (cop) {
			if (cop % 2)invp[sz - 1] = invp[sz - 1] * x%mod;
			cop >>= 1; x = x * x % mod;
		}
		per(i, sz - 1) {
			invp[i] = invp[i + 1] * (i + 1) % mod;
		}
	}
	ll comb(ll x, ll y) {
		if (x < y || y < 0)return 0;
		ll ret = p[x];
		(ret *= invp[y]) %= mod;
		(ret *= invp[x - y]) %= mod;
		return ret;
	}
	ll combP(ll x, ll y) {
		if (x < y || y < 0)return 0;
		return p[x] * invp[x - y] % mod;
	}
};

int ri[1 << 19][27];
int nex[1 << 19][19];

int alnex[1 << 19][27];
void solve() {
	string s; cin >> s;
	int n = s.size();
	per(i, n) {
		rep(j, 27)alnex[i][j] = -1;
		int t = s[i] - 'a';
		alnex[i][t] = i + 1;
		for (int j = t + 1; j < 27; j++) {
			int to = alnex[i][j - 1];
			if (to < 0||to==n) {
				alnex[i][j] = -1;
			}
			else {
				if (s[to] - 'a' < j) {
					alnex[i][j] = alnex[to][j - 1];
				}
				else {
					to = ri[to][j];
					if (to < 0 || to == n)alnex[i][j] = -1;
					else alnex[i][j] = alnex[to][j - 1];
				}
			}
		}
		int cur = alnex[i][26];
		//cout << i << " " << cur << endl;
		nex[i][0] = cur;
		int las = s[i] - 'a';
		for (int j = 0; j <= las; j++) {
			if (cur < 0 || cur == n)ri[i][j] = cur;
			else {
				ri[i][j] = ri[cur][j];
			}
		}
		for (int j = las + 1; j < 26; j++)ri[i][j] = i;
	}
	rep(j,18) {
		rep(i,n) {
			if (0 <= nex[i][j] && nex[i][j] < n) {
				nex[i][j + 1] = nex[nex[i][j]][j];
			}
			else {
				nex[i][j + 1] = nex[i][j];
			}
		}
	}
	int q; cin >> q;
	rep(aa, q) {
		int l, r; cin >> l >> r; l--;
		int cur = l;
		per(i, 19) {
			int to = nex[cur][i];
			if (to >= 0 && to <= r) {
				//if (aa == 1)cout << cur << " " << i << " " << to << endl;
				cur = to;
			}
			if (cur < 0 || cur == n)break;
		}
		if (cur == r) {
			cout << "Yes" << endl;
		}
		else {
			//cout << cur << endl;
			cout << "No" << endl;
		}
	}
}


signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(17);
	//init();
	//int t; cin >> t; rep(i, t)solve();
	solve();
	stop
		return 0;
}


Measured memory_bytes: 146716