#include <bits/stdc++.h>

using namespace std;

const int N = 500010;
const int LOG = 21;
const int ALPHA = 28;

int pr[N][LOG];
int f[N][ALPHA];
int a[N];
char foo[N];

int main() {
  scanf("%s", foo);
  int len = strlen(foo);
  for (int i = 0; i < len; i++) {
    a[i] = foo[i] - 'a';
  }
  for (int c = 0; c <= 26; c++) {
    f[len][c] = -1;
  }
  for (int i = len - 1; i >= 0; i--) {
    for (int c = 0; c <= 26; c++) {
      f[i][c] = -1;
    }
    f[i][a[i]] = i + 1;
    bool err = false;
    for (int c = a[i] + 1; c <= 26; c++) {
      int at = f[f[i][c - 1]][c - 1];
      if (at == -1) {
        err = true;
        break;
      }
      f[i][c] = at;
    }
    if (!err) {
      for (int c = 0; c < a[i]; c++) {
        f[i][c] = f[f[i][26]][c];
      }
    }
  }
  for (int i = 0; i <= len; i++) {
    pr[i][0] = f[i][26];
  }
  for (int j = 1; j < LOG; j++) {
    for (int i = 0; i <= len; i++) {
      if (pr[i][j - 1] == -1) {
        pr[i][j] = -1;
      } else {
        pr[i][j] = pr[pr[i][j - 1]][j - 1];
      }
    }
  }
  int tt;
  scanf("%d", &tt);
  while (tt--) {
    int x, y;
    scanf("%d %d", &x, &y);
    x--;
    for (int j = LOG - 1; j >= 0; j--) {
      if (pr[x][j] == -1) {
        continue;
      }
      if (pr[x][j] <= y) {
        x = pr[x][j];
      }
    }
    puts((x == y) ? "Yes" : "No");
  }
  return 0;
}
