#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vpi = vector<pair<int, int>>;
using pi = pair<int, int>;
const int nax = 1.5e7 + 7;
const int mod = 1e9 + 7;
const int inf = numeric_limits<int>::max() - (int)9e6;
void test() {
  string s;
  cin >> s;
  int n = ((int)(s).size());
  int q;
  cin >> q;
  vvi p(n, vi(26));
  for (int i = 0; i < n; i++) {
    p[i][s[i] - 'a']++;
    for (int j = 0; j < 26; j++) {
      if (i > 0) {
        p[i][j] += p[i - 1][j];
      }
    }
  }
  auto get_dis = [&](int l, int r) {
    int dis = 0;
    for (int i = 0; i < 26; i++) {
      dis += (l == 0 ? p[r][i] : p[r][i] - p[l - 1][i]) > 0;
    }
    return dis;
  };
  auto up = [&](int l, int r) {
    if (l == r) return true;
    if (s[l] != s[r]) return true;
    if (get_dis(l, r) > 2)
      return true;
    else
      return false;
  };
  while (q--) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    cout << (up(a, b) ? "Yes" : "No") << '\n';
  }
}
signed main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  while (T--) {
    test();
  }
  return 0;
}
