#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, s, t, x, y, ans, l, r, T;
char ch[200010];
int a[200010][30], b[30];
int main() {
  scanf("%s", ch + 1);
  n = 1;
  while (ch[n] != '\0') n++;
  n--;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= 26; j++) {
      a[i][j] = a[i - 1][j];
    }
    t = ch[i] - 'a' + 1;
    a[i][t]++;
  }
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d", &l, &r);
    if (l == r) {
      puts("Yes");
      continue;
    }
    t = 0;
    for (i = 1; i <= 26; i++) {
      b[i] = a[r][i] - a[l - 1][i];
      if (b[i] > 0) t++;
    }
    if (ch[l] != ch[r]) {
      puts("Yes");
      continue;
    }
    if (t >= 3) {
      puts("Yes");
      continue;
    }
    puts("No");
  }
}
