#include <bits/stdc++.h>
using namespace std;
const int N = 200010 + 5;
char s[N];
int n, t, sum[N][26], l, r, cnt[26];
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= n; i++) {
    memcpy(sum[i], sum[i - 1], sizeof sum[i]);
    sum[i][s[i] - 'a']++;
  }
  cin >> t;
  while (t--) {
    cin >> l >> r;
    if (r - l == 0) {
      puts("YES");
      continue;
    }
    int x = 0;
    for (int i = 0; i < 26; i++) {
      cnt[i] = sum[r][i] - sum[l - 1][i];
      if (cnt[i]) x++;
    }
    if (s[l] == s[r] && x <= 2) {
      cout << "NO" << endl;
    } else
      cout << "YES" << endl;
  }
  return 0;
}
