#include <bits/stdc++.h>
char s[200010];
int last[200010][27];
int i, j, n, m;
int main() {
  scanf("%s", &s[1]);
  for (i = 1; s[i]; i++) {
    for (j = 0; j < 26; j++) {
      if (s[i] != j + 'a') {
        last[i][j] = last[i - 1][j];
      } else {
        last[i][j] = i;
      }
    }
  }
  int nn;
  scanf("%d", &nn);
  int a, b;
  while (nn--) {
    scanf("%d %d", &a, &b);
    if (a == b) {
      printf("YES\n");
      continue;
    }
    if (s[a] != s[b]) {
      printf("YES\n");
      continue;
    }
    i = 0;
    for (j = 0; j < 26; j++) {
      if (last[b][j] >= a) {
        i++;
      }
    }
    if (i > 2)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
