#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2000002;
const int MOD = 1000000007;
const double EPS = 1e-9;
int freq[MAXN][28];
int main() {
  char pal[MAXN];
  scanf("%s", pal);
  int n = strlen(pal);
  for (int i = 0; i < n; i++) {
    for (int j = 'a'; j <= 'z'; j++) {
      if (i) freq[i][j - 'a'] += freq[i - 1][j - 'a'];
      if (pal[i] == j) freq[i][j - 'a']++;
    }
  }
  int m;
  scanf("%d", &m);
  while (m--) {
    int l, r;
    scanf("%d %d", &l, &r);
    l--, r--;
    int diff = 0;
    for (int i = 'a'; i <= 'z'; i++) {
      int f = freq[r][i - 'a'];
      if (l) f -= freq[l - 1][i - 'a'];
      if (f) diff++;
    }
    if (diff == 1) {
      printf("%s\n", l == r ? "Yes" : "No");
    } else if (diff == 2) {
      printf("%s\n", pal[l] == pal[r] ? "No" : "Yes");
    } else {
      printf("Yes\n");
    }
  }
  return 0;
}
