#include <bits/stdc++.h>
using namespace std;
char s[200100];
int c[200100][26];
int q, l, r;
int check(int lx, int rx, char k) {
  int res = 0;
  for (int i = 0; i < 26; i++) {
    if (i + 'a' != k) res += (c[rx][i] - c[lx][i] > 0);
  }
  return res;
}
int calc(int lx, int rx) {
  if (lx == rx) return 1;
  if (s[lx - 1] != s[rx - 1]) return 1;
  if (check(lx - 1, rx, s[lx - 1]) <= 1) return 0;
  return 1;
}
int main() {
  cin >> s >> q;
  l = strlen(s);
  for (int i = 1; i <= l; i++) {
    for (int j = 0; j < 26; j++) {
      c[i][j] = c[i - 1][j] + (s[i - 1] == 'a' + j);
    }
  }
  while (q--) {
    cin >> l >> r;
    cout << (calc(l, r) ? "Yes" : "No") << endl;
  }
}
