#include <bits/stdc++.h>
using namespace std;
long long lr, hr;
int main() {
  long long n, q;
  string s;
  cin >> s;
  n = s.length();
  cin >> q;
  vector<pair<long long, long long>> qry(q);
  for (long long i = 0; i < q; i++) {
    long long a, b;
    cin >> a >> b;
    qry[i] = make_pair(a, b);
  }
  vector<vector<long long>> sum(n + 1, vector<long long>(26, 0));
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j < 26; j++) {
      if (s[i - 1] == j + 'a') {
        sum[i][j] = sum[i - 1][j] + 1;
      } else
        sum[i][j] = sum[i - 1][j];
    }
  }
  for (long long i = 0; i < q; i++) {
    long long l = qry[i].first, r = qry[i].second;
    if (l == r || s[l - 1] != s[r - 1]) {
      cout << "YES" << endl;
    } else {
      long long cnt = 0;
      for (long long i = 0; i < 26; i++) {
        if (sum[r][i] - sum[l - 1][i] > 0) cnt += 1;
      }
      if (cnt >= 3)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
}
