#include <bits/stdc++.h>
const double PI = 3.1415926;
const int KL = 1e6;
using namespace std;
long long q, x, y, z, n, m, mn = 1e9, mx = -1e9, ans;
string t;
vector<long long> vec;
set<int> s;
map<int, int> M;
long long a[KL], seg[3 * KL], k2[30];
void build(int cur, int st, int en) {
  if (st == en)
    seg[cur] = a[st];
  else {
    int mid = (st + en) / 2;
    build(2 * cur, st, mid);
    build(2 * cur + 1, mid + 1, en);
    seg[cur] = (seg[2 * cur] | seg[2 * cur + 1]);
  }
}
long long sm(int cur, int st, int en, int l, int r) {
  if (l > r) return 0;
  if (st == l && en == r) return seg[cur];
  int mid = (st + en) / 2;
  long long pas1 = sm(2 * cur, st, mid, l, min(r, mid));
  long long pas2 = sm(2 * cur + 1, mid + 1, en, max(l, mid + 1), r);
  return (pas1 | pas2);
}
int main() {
  cin >> t;
  n = t.size();
  k2[0] = 1;
  for (int i = 1; i <= 26; i++) k2[i] = 2 * k2[i - 1];
  for (int i = 0; i < n; i++) {
    x = t[i] - 'a';
    a[i] = k2[x];
  }
  build(1, 0, n - 1);
  scanf("%lld", &q);
  while (q--) {
    int p1, p2;
    scanf("%d", &p1);
    scanf("%d", &p2);
    p1--;
    p2--;
    if (p2 - p1 == 0) {
      cout << "Yes" << endl;
      continue;
    }
    ans = sm(1, 0, n - 1, p1, p2);
    long long cnt = 0;
    while (ans != 0) {
      if (ans % 2 == 1) cnt++;
      ans /= 2;
    }
    if (cnt == 1)
      cout << "No" << endl;
    else if (cnt >= 3)
      cout << "Yes" << endl;
    else {
      if (t[p1] == t[p2])
        cout << "No" << endl;
      else
        cout << "Yes" << endl;
    }
  }
  return 0;
}
