#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int maxn = 2e5 + 9;
const int inf = 0x3f3f3f3f;
long long rd() {
  long long ans = 0;
  char last = ' ', ch = getchar();
  while (!(ch >= '0' && ch <= '9')) last = ch, ch = getchar();
  while (ch >= '0' && ch <= '9') ans = ans * 10 + ch - '0', ch = getchar();
  if (last == '-') ans = -ans;
  return ans;
}
char x[maxn];
int ct[maxn][26];
int main() {
  scanf("%s", x + 1);
  int n = strlen(x + 1);
  for (int i = (int)(1); i <= (int)(n); i++) {
    ct[i][x[i] - 'a'] = 1;
    for (int j = (int)(0); j <= (int)(25); j++) ct[i][j] += ct[i - 1][j];
  }
  int q = rd();
  while (q--) {
    int l = rd(), r = rd();
    if (l == r) {
      puts("Yes");
      continue;
    }
    int co = 0;
    for (int i = (int)(0); i <= (int)(25); i++) {
      if (ct[r][i] - ct[l - 1][i] > 0) co++;
    }
    if (co == 1) {
      puts("No");
      continue;
    }
    if (co > 2) {
      puts("Yes");
      continue;
    }
    if (x[l] == x[r]) {
      puts("No");
      continue;
    }
    puts("Yes");
  }
  return 0;
}
