#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int t, z = 0;
  string s;
  cin >> s;
  long long int a[26], sum[26][s.size()];
  memset(a, 0, sizeof(a));
  memset(sum, 0, sizeof(sum));
  sum[s[0] - 97][0] = 1;
  for (long long int i = 1; i < s.size(); ++i) {
    for (long long int j = 0; j < 26; ++j) {
      sum[j][i] = sum[j][i - 1];
    }
    sum[s[i] - 97][i]++;
  }
  cin >> t;
  while (t--) {
    long long int l, r, flag1 = 0, flag2 = 0, c = 0;
    cin >> l >> r;
    for (long long int i = 0; i < 26; ++i) {
      if (sum[i][r - 1] - sum[i][l - 1] > 0) c++;
    }
    if (s[l - 1] != s[r - 1]) flag1 = 1;
    if (l == r) flag2 = 1;
    {
      if (flag1 || flag2 || c >= 3)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
  }
  return 0;
}
