#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
string s;
int pref[26][N];
int ret(int l, int r, int c) { return pref[c][r] - pref[c][l - 1]; }
int main() {
  cin >> s;
  int n = (int)s.size();
  for (int i = 1; i <= n; ++i) {
    for (int c = 0; c < 26; ++c) {
      pref[c][i] += pref[c][i - 1];
    }
    pref[s[i - 1] - 'a'][i]++;
  }
  int q;
  cin >> q;
  for (int qw = 0; qw < q; ++qw) {
    int l, r;
    cin >> l >> r;
    if (l == r) {
      cout << "Yes";
    } else if (s[l - 1] != s[r - 1]) {
      cout << "Yes";
    } else {
      int cnt = 0;
      for (int c = 0; c < 26; ++c) {
        if (ret(l, r, c) > 0) {
          cnt++;
        }
      }
      if (cnt <= 2) {
        cout << "No";
      } else {
        cout << "Yes";
      }
    }
    cout << "\n";
  }
  return 0;
}
