#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
char s[N];
int q, l, r;
vector<int> pos[26];
vector<int>::iterator it;
vector<int> now;
int main() {
  scanf("%s", s + 1);
  int len = strlen(s + 1);
  for (int i = 1; i <= len; ++i) pos[s[i] - 'a'].push_back(i);
  for (int i = 0; i < 26; ++i) pos[i].push_back(len + 1);
  scanf("%d", &q);
  while (q--) {
    scanf("%d%d", &l, &r);
    if (l == r) {
      puts("Yes");
      continue;
    }
    now.clear();
    for (int i = 0; i < 26; ++i) {
      it = lower_bound(pos[i].begin(), pos[i].end(), l);
      if ((*it) <= r) now.push_back(i);
    }
    int len = now.size();
    if (len == 1 || (len == 2 && s[l] == s[r]))
      puts("No");
    else
      puts("Yes");
  }
  return 0;
}
