#include <bits/stdc++.h>
using namespace std;
const int PRIME = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  int q;
  cin >> q;
  vector<vector<int>> letPrefSum((int)s.size() + 1, vector<int>(26, 0));
  for (int i = 0; i < (int)s.size(); i++) {
    letPrefSum[i + 1][s[i] - 'a']++;
    for (int j = 0; j < 26; j++) {
      letPrefSum[i + 1][j] += letPrefSum[i][j];
    }
  }
  for (int i = 0; i < q; i++) {
    int l, r;
    cin >> l >> r;
    l--;
    if (s[l] != s[r - 1] || l + 1 == r) {
      cout << "YES\n";
      continue;
    }
    int possibleSwap = 0;
    for (int j = 0; j < 26; j++) {
      int numLets = letPrefSum[r - 1][j] - letPrefSum[l + 1][j];
      if (j != s[l] - 'a' && numLets) {
        possibleSwap += 1;
      }
    }
    if (possibleSwap >= 2) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
}
