#include <bits/stdc++.h>
using namespace std;
inline bool invowel(char ch) {
  ch = tolower(ch);
  return (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u');
}
inline bool isprime(int n) {
  if (n < 2 || (n % 2 == 0 && n != 2)) return false;
  for (int i = 3; i * i <= n; i += 2)
    if (n % i == 0) return false;
  return true;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  string s;
  int q, n, i, j;
  cin >> s >> q;
  n = s.size();
  int pref[n + 1][26];
  for (i = 0; i < 26; i++) pref[0][i] = 0;
  for (i = 0; i < n; i++) {
    int p = int(s[i] - 'a');
    for (j = 0; j < 26; j++) {
      pref[i + 1][j] = pref[i][j];
    }
    pref[i + 1][p]++;
  }
  while (q--) {
    int l, r;
    cin >> l >> r;
    int flag = 0;
    for (i = 0; i < 26; i++) {
      flag += (pref[r][i] - pref[l - 1][i] ? 1 : 0);
    }
    if (l == r || flag >= 3 || s[r - 1] != s[l - 1]) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  }
  return 0;
}
