#include <bits/stdc++.h>
using namespace std;
char s[200011];
int q, l, r;
int pre[200011][26];
int main(int argc, char const *argv[]) {
  scanf("%s%d", s + 1, &q);
  int n = strlen(s + 1);
  for (int i = 1; i <= n; i++) {
    memcpy(pre[i], pre[i - 1], sizeof(pre[i]));
    pre[i][s[i] - 'a']++;
  }
  while (q--) {
    scanf("%d%d", &l, &r);
    if (r == l || s[l] != s[r]) {
      cout << "Yes" << endl;
      continue;
    }
    int cnt = 0;
    for (int i = 0; i < 26; i++) {
      if (pre[r][i] - pre[l - 1][i] > 0) {
        cnt++;
      }
      if (cnt >= 3) break;
    }
    if (cnt >= 3)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
