#include <bits/stdc++.h>
using namespace std;
int cnt[222222][33];
char S[222222];
int main() {
  scanf("%s", S + 1);
  for (int i = 1; S[i]; ++i) {
    for (int j = 'a'; j <= 'z'; ++j) {
      cnt[i][j - 'a'] = cnt[i - 1][j - 'a'] + (S[i] == j);
    }
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    int l, r;
    scanf("%d%d", &l, &r);
    int c = 0;
    for (int i = 0; i < 26; ++i) c += (cnt[r][i] - cnt[l - 1][i]) > 0;
    if (l == r || c >= 3 || S[l] != S[r]) {
      puts("Yes");
      continue;
    }
    puts("No");
  }
  return 0;
}
