#include <bits/stdc++.h>
using namespace std;
const long long MX = 2e5 + 9;
long long ps[26][MX];
long long num(long long l, long long r) {
  long long ans = 0;
  for (long long i = 0; i < 26; i++) {
    if (ps[i][r] - ps[i][l] > 0) ans++;
  }
  return ans;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  long long n = s.size();
  for (long long i = 1; i <= n; i++) {
    for (long long j = 0; j < 26; j++) {
      ps[j][i] = ps[j][i - 1];
    }
    ps[s[i - 1] - 'a'][i]++;
  }
  long long q;
  cin >> q;
  while (q--) {
    long long l, r;
    cin >> l >> r;
    l--;
    if (r - l == 1 || num(l, r) > 2 || s[r - 1] != s[l]) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
