#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-8;
const int INF = 0x3F3F3F3F;
const long long LINF = 4611686018427387903;
const int MOD = 1e9 + 7;
const int MAXN = 2e5 + 9;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  string s;
  int n;
  set<int> cnt[26];
  cin >> s >> n;
  for (int i = 0; i < s.size(); i++) {
    cnt[s[i] - 'a'].insert(i);
  }
  for (int i = 0, a, b; i < n; i++) {
    cin >> a >> b;
    string t = s.substr(a - 1, b - a + 1);
    if (t.size() == 1)
      cout << "YES";
    else if (t.front() != t.back())
      cout << "YES";
    else {
      int ccnt = 0;
      for (int i = 0; i < 26; i++) {
        if (i == (t.front() - 'a')) continue;
        auto it = cnt[i].lower_bound(a);
        if (it == cnt[i].end()) continue;
        if (*it >= b) continue;
        ccnt++;
      }
      if (ccnt > 1) {
        cout << "YES";
      } else
        cout << "NO";
    }
    cout << '\n';
  }
  return 0;
}
