#include <bits/stdc++.h>
using namespace std;
const int N = 200050;
char s[N];
int sum[N][30];
vector<int> v[30];
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  for (int z = 0; z < 26; ++z) {
    for (int i = 1; i <= n; ++i) sum[i][z] = sum[i - 1][z] + (s[i] == 'a' + z);
  }
  int Q;
  cin >> Q;
  while (Q--) {
    int l, r;
    scanf("%d%d", &l, &r);
    int cnt = 0;
    if (l == r) {
      puts("Yes");
      continue;
    }
    for (int i = 0; i < 30; ++i) {
      cnt += (sum[r][i] - sum[l - 1][i] > 0);
    }
    if (cnt >= 3) {
      puts("Yes");
      continue;
    } else if (cnt == 1 || (cnt == 2 && s[l] == s[r])) {
      puts("No");
    } else
      puts("Yes");
  }
  return 0;
}
