28237
 13190
 39914
 81367
 8554
 61106
 67448
 39004
 22308
 16054
 71468
 60501
 100
 300
 59632
 90783
 5611
 1000
 69475
 69753
 10
 5
 582
 8
 36961
 5071
 20
 53213
 92775
 28738
 100000
 92280
 37944
 9
 2627
 7
 3

1028306548 224346172 2054738392 8539207488 94344524 4816051228 5867563092 1962150044 641839188 332342852 6587875268 4721174212 12600 115440 4586497300 10630118936 40580456 1286328 6225539588 6275533596 92 8 434692 52 1762017168 33141852 440 3652070664 11101694484 1065137992 12898363344 10983871880 1856988304 64 8885348 28 0
#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef double db;
typedef string str;
typedef pair<long long, long long> pl;
typedef pair<ld, ld> pd;
typedef vector<ld> vd;
typedef vector<str> vs;
typedef vector<pl> vpl;
const int MOD = 1e9 + 7;
const int MX = 2e5 + 5;
const long long INF = 1e18;
const ld PI = 4 * atan((ld)1);
template <class T>
bool ckmin(T& a, const T& b) {
  return a > b ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());
using vvi = vector<vector<int> >;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string second;
  cin >> second;
  int n = (int)second.size();
  vvi first;
  first.push_back(vector<int>(26, 0));
  for (int i = (0); i < (n); ++i) {
    first.push_back(vector<int>(26));
    for (int j = (0); j < (26); ++j) first[i + 1][j] = first[i][j];
    first[i + 1][second[i] - 'a']++;
  }
  int q;
  cin >> q;
  for (int i = (0); i < (q); ++i) {
    int l, r;
    cin >> l >> r;
    int cnt = 0;
    for (int j = (0); j < (26); ++j) {
      if (first[r][j] - first[l - 1][j] > 0) cnt++;
    }
    if (second[r - 1] != second[l - 1] || l == r || cnt > 2)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
