#include <bits/stdc++.h>
using namespace std;
char plswork[200050];
int workpls[200050];
int statsum[200050][30];
int main() {
  int n, tc, temp, tmep, tpem;
  scanf("%s", plswork);
  n = strlen(plswork);
  for (int i = 0; i < n; i++) {
    workpls[i] = plswork[i] - 'a';
    for (int k = 0; k < 30; k++) {
      if (k == workpls[i]) {
        statsum[i + 1][k] = statsum[i][k] + 1;
      } else {
        statsum[i + 1][k] = statsum[i][k];
      }
    }
  }
  scanf("%d", &tc);
  for (int i = 0; i < tc; i++) {
    scanf("%d%d", &temp, &tmep);
    if (temp == tmep) {
      printf("Yes\n");
      continue;
    }
    if (workpls[temp - 1] != workpls[tmep - 1]) {
      printf("Yes\n");
      continue;
    }
    tpem = 0;
    for (int k = 0; k < 30; k++) {
      if (statsum[tmep][k] - statsum[temp - 1][k] > 0) {
        tpem++;
      }
    }
    if (tpem >= 3) {
      printf("Yes\n");
      continue;
    }
    printf("No\n");
  }
}
