#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-7;
int main() {
  string s;
  cin >> s;
  long long int n = (long long int)s.size();
  vector<long long int> v[30];
  for (char ch = 'a'; ch <= 'z'; ch++) {
    long long int x = ch - 'a';
    long long int cnt = 0;
    for (long long int i = 0; i < n; i++) {
      if (s[i] == ch) cnt++;
      v[x].push_back(cnt);
    }
  }
  long long int q;
  cin >> q;
  while (q--) {
    long long int l, r;
    cin >> l >> r;
    l--;
    r--;
    long long int f = 0;
    if (l == r) f = 1;
    if (s[l] != s[r]) f = 1;
    long long int tot = 0;
    for (char ch = 'a'; ch <= 'z'; ch++) {
      long long int x = ch - 'a';
      long long int sum = v[x][r];
      if (l - 1 >= 0) sum -= v[x][l - 1];
      if (sum) tot++;
    }
    if (tot >= 3) f = 1;
    if (f)
      cout << "YES"
           << "\n";
    else
      cout << "NO"
           << "\n";
  }
}
