#include <bits/stdc++.h>
using namespace std;
const long long int N = 2e5 + 5;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
  string s;
  cin >> s;
  long long int n, i, j, t, l, r, diff;
  n = s.size();
  vector<vector<long long int> > a(26, vector<long long int>(s.size() + 1, 0));
  for (i = 1; i <= n; i++) {
    a[s[i - 1] - 'a'][i]++;
    for (j = 0; j < 26; j++) {
      a[j][i] += a[j][i - 1];
    }
  }
  cin >> t;
  while (t--) {
    cin >> l >> r;
    diff = 0;
    long long int ctr[26] = {0};
    for (i = 0; i < 26; i++) {
      ctr[i] = a[i][r] - a[i][l - 1];
      if (ctr[i] != 0) diff++;
    }
    if (diff > 2)
      cout << "YES" << '\n';
    else if (s[l - 1] != s[r - 1])
      cout << "YES" << '\n';
    else if (l - r == 0)
      cout << "YES" << '\n';
    else
      cout << "NO" << '\n';
  }
  return 0;
}
