#include <bits/stdc++.h>
void err() { std::cout << std::endl; }
template <typename T, typename... Args>
void err(T a, Args... args) {
  std::cout << a << ' ';
  err(args...);
}
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 22;
char s[maxn];
int q, l, r;
map<int, int> m;
map<int, char> k;
int pre[maxn][30];
int main() {
  scanf("%s", s + 1);
  int len = strlen(s + 1), cnt = 1;
  m[1] = 1;
  k[1] = s[1];
  for (int i = 2; i <= len; i++) {
    if (s[i] != s[i - 1]) {
      cnt++;
      k[cnt] = s[i];
    }
    m[i] = cnt;
  }
  for (int i = 1; i <= cnt; i++) {
    for (int j = 0; j <= 25; j++) {
      pre[i][j] = pre[i - 1][j];
    }
    pre[i][k[i] - 'a']++;
  }
  scanf("%d", &q);
  while (q--) {
    scanf("%d%d", &l, &r);
    int S = 0;
    for (int j = 0; j <= 25; j++) {
      if (pre[m[r]][j] - pre[m[l] - 1][j] > 0) S++;
    }
    if (S == 1) {
      if (l == r)
        puts("Yes");
      else
        puts("No");
    } else if (S > 2) {
      puts("Yes");
    } else {
      if (s[l] != s[r]) {
        puts("Yes");
      } else {
        puts("No");
      }
    }
  }
  return 0;
}
