#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";
  }
}
