#include <bits/stdc++.h>
using namespace std;
const int SQN = 500, MAXN = 2e5 + 7;
struct query {
  int l, r, id;
  query(int ll, int rr, int idd) {
    l = ll;
    r = rr;
    id = idd;
  }
  query() {}
};
bool cmp(query q1, query q2) {
  if (q1.l / SQN == q2.l / SQN) return q1.r < q2.r;
  return q1.l < q2.l;
}
string s;
int q, f[30], fr[MAXN][30], ult[30], num = 0;
bool ans[MAXN];
vector<query> aux;
inline void adic(int idx) {
  if (f[s[idx] - 'a'] == 0) num++;
  f[s[idx] - 'a']++;
}
inline void tira(int idx) {
  f[s[idx] - 'a']--;
  if (f[s[idx] - 'a'] == 0) num--;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> s;
  for (int i = 0; i < 30; i++) ult[i] = -1;
  for (int i = 0; i < (int)s.size(); i++) {
    ult[s[i] - 'a'] = i;
    for (int j = 0; j < 30; j++) fr[i][j] = ult[j];
  }
  cin >> q;
  for (int i = 0; i < q; i++) {
    int li, ri;
    cin >> li >> ri;
    li--;
    ri--;
    aux.push_back(query(li, ri, i));
  }
  sort(aux.begin(), aux.end(), cmp);
  int mo_left = 0;
  int mo_right = -1;
  for (int i = 0; i < q; i++) {
    int li = aux[i].l;
    int ri = aux[i].r;
    int ii = aux[i].id;
    while (mo_left < li) tira(mo_left++);
    while (mo_left > li) adic(--mo_left);
    while (mo_right < ri) adic(++mo_right);
    while (mo_right > ri) tira(mo_right--);
    char fi = s[ri];
    char fg = s[li];
    if (li == ri || fi != fg || num >= 3)
      ans[ii] = true;
    else
      ans[ii] = false;
  }
  for (int i = 0; i < q; i++) {
    if (ans[i])
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
