#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
int p[26][maxn];
int main(int argc, char const *argv[]) {
  string s;
  cin >> s;
  int n = s.size();
  for (int i = 0; i < n; i++) {
    p[s[i] - 'a'][i] = 1;
  }
  for (int i = 0; i < 26; i++) {
    for (int j = 0; j < n; j++) {
      if (j) {
        p[i][j] += p[i][j - 1];
      }
    }
  }
  int q;
  scanf("%d", &q);
  while (q--) {
    int l, r;
    scanf("%d %d", &l, &r);
    int cnt = 0;
    for (int i = 0; i < 26; i++) {
      if (p[i][r - 1] - p[i][l - 2] > 0) {
        cnt++;
      }
    }
    if (s[l - 1] != s[r - 1]) {
      printf("Yes\n");
    } else if (cnt >= 3) {
      printf("Yes\n");
    } else if (l == r) {
      printf("Yes\n");
    } else {
      printf("No\n");
    }
  }
  return 0;
}
