#include <bits/stdc++.h>
using namespace std;
int n;
char s[200002];
int cnt[200001][26];
void init() {
  for (int i = 1; s[i]; ++i) {
    for (int j = 0; j < 26; ++j) cnt[i][j] = cnt[i - 1][j];
    cnt[i][s[i] - 'a']++;
  }
}
int main() {
  scanf("%s", s + 1);
  init();
  int q, l, r;
  scanf("%d", &q);
  while (q--) {
    scanf("%d%d", &l, &r);
    int diff = 0;
    for (int i = 0; i < 26; ++i) diff += (cnt[l - 1][i] != cnt[r][i]);
    if (l == r || s[l] != s[r] || diff > 2)
      puts("Yes");
    else
      puts("No");
  }
}
