#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 9;
string s;
int pref[MAX][26];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> s;
  s.insert(0, 1, '*');
  for (int i = 1; i < s.size(); ++i) {
    ++pref[i][s[i] - 'a'];
    for (int j = 0; j < 26; ++j) {
      pref[i][j] += pref[i - 1][j];
    }
  }
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    if (l == r || s[l] != s[r]) {
      cout << "Yes\n";
      continue;
    }
    int cnt = 0;
    for (int i = 0; i < 26; ++i) {
      if (pref[r][i] - pref[l - 1][i]) {
        ++cnt;
      }
    }
    cout << (cnt > 2 ? "Yes\n" : "No\n");
  }
  return 0;
}
