#include <bits/stdc++.h>
using namespace std;
template <typename T>
void read_to_vector(size_t N, std::vector<T> &v) {
  for (size_t i = 0; i < N; i++) {
    T tmp;
    std::cin >> tmp;
    v.push_back(tmp);
  }
}
template <typename T>
void print_vector(const std::vector<T> &v) {
  for (auto it = v.begin(); it < v.end(); it++) {
    if (it != v.begin()) std::cout << " ";
    std::cout << (*it);
  }
}
struct BIT {
  std::vector<long long> T;
  BIT(long long n) { T = std::vector<long long>(n + 3, 0); }
  long long get(long long i) const {
    i++;
    long long s = 0;
    while (i > 0) {
      s += T[i];
      i -= i & -i;
    }
    return s;
  }
  void add(long long i, long long a) {
    i++;
    while (i < T.size()) {
      T[i] += a;
      i += i & -i;
    }
  }
  long long range(long long a, long long b) const {
    return get(b) - get(a - 1);
  }
};
void solve() {
  string s;
  cin >> s;
  long long q;
  cin >> q;
  long long n = s.size();
  vector<BIT> bit(128, BIT(n));
  for (int i = 0; i < n; i++) {
    bit[s[i]].add(i, 1);
  }
  for (int i = 0; i < q; i++) {
    long long l, r;
    cin >> l >> r;
    l--;
    r--;
    if (l == r) {
      cout << "Yes\n";
      continue;
    }
    if (s[l] != s[r]) {
      cout << "Yes\n";
      continue;
    }
    long long count1 = 0;
    for (char c = 'a'; c <= 'z'; c++) {
      count1 += (bit[c].range(l, r) > 0);
    }
    if (count1 > 2) {
      cout << "Yes\n";
      continue;
    }
    cout << "No\n";
  }
}
void pre_compute() {}
int main() {
  std::cout << std::setprecision(15);
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  pre_compute();
  solve();
  return 0;
}
