Problem: You are developing a robot that processes strings. When the robot is given a string t consisting of lowercase English letters, it processes the string by following the procedure below:

1. Let i be the smallest index such that t_i = t_{i + 1}. If such an index does not exist, terminate the procedure.
2. If t_i is `z`, remove t_i and t_{i + 1} from t. Otherwise, let c be the next letter of t_i in the English alphabet, and replace t_i and t_{i + 1} together with c, reducing the length of t by 1.
3. Go back to step 1.



For example, when the robot is given the string `axxxxza`, it will be processed as follows: `axxxxza` → `ayxxza` → `ayyza` → `azza` → `aa` → `b`.

You are given a string s consisting of lowercase English letters. Answer Q queries. The i-th query is as follows:

* Assume that the robot is given a substring of s that runs from the l_i-th character and up to the r_i-th character (inclusive). Will the string be empty after processing?

Constraints

* 1 ≤ |s| ≤ 5 × 10^5
* s consists of lowercase English letters.
* 1 ≤ Q ≤ 10^5
* 1 ≤ l_i ≤ r_i ≤ |s|

Input

The input is given from Standard Input in the following format:


s
Q
l_1 r_1
l_2 r_2
:
l_Q r_Q


Output

Print Q lines. The i-th line should contain the answer to the i-th query: `Yes` or `No`.

Examples

Input

axxxxza
2
1 7
2 6


Output

No
Yes


Input

aabcdefghijklmnopqrstuvwxyz
1
1 27


Output

Yes


Input

yzyyyzyzyyyz
8
1 6
7 12
1 12
6 11
1 1
1 3
4 9
3 8


Output

Yes
Yes
Yes
Yes
No
No
No
No

Solution (in CPP):

Solution:
#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;
}