#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int pref[N][26];
void solve() {
  string s;
  cin >> s;
  int n = s.length();
  for (int i = 0; i < n; i++) {
    pref[i + 1][s[i] - 'a'] = 1;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 26; j++) {
      pref[i + 1][j] += pref[i][j];
    }
  }
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    if (l == r) {
      cout << "Yes" << endl;
      continue;
    }
    l--;
    int cnt = 0;
    for (int i = 0; i < 26; i++) {
      if (pref[r][i] - pref[l][i] > 0) cnt++;
    }
    l++;
    if (cnt <= 2 && s[l - 1] == s[r - 1]) {
      cout << "No" << endl;
    } else
      cout << "Yes" << endl;
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int tc = 1;
  for (int j = 1; j <= tc; j++) {
    solve();
  }
  return 0;
}
