#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using pll = pair<ll, ll>;
template <typename U, typename V>
string to_string(pair<U, V>);
string to_string(string& e) { return "\"" + e + "\""; }
string to_string(char e) { return "\'" + string(1, e) + "\'"; }
string to_string(bool e) { return e ? "true" : "false"; }
template <typename T>
string to_string(T e) {
  string s = "[ ";
  for (auto& x : e) s += to_string(x) + " ";
  return s + "]";
}
template <typename U, typename V>
string to_string(pair<U, V> e) {
  return "(" + to_string(e.first) + ", " + to_string(e.second) + ")";
}
void dbg_str() { ; }
template <typename U, typename... V>
void dbg_str(U u, V... v) {
  ;
  dbg_str(v...);
}
const int N = 200010;
const int K = 26;
char s[N];
int n, f[N][K];
int distinct(int l, int r) {
  int res = 0;
  for (int i = 0; i < K; i++)
    if (f[r][i] - f[l - 1][i] > 0) res++;
  return res;
}
bool can(int l, int r) {
  if (l == r) return true;
  if (distinct(l, r) <= 2 && s[l] == s[r]) return false;
  return true;
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  memset(f, 0, sizeof f);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < K; j++) f[i][j] = (s[i] - 'a' == j) + f[i - 1][j];
  }
  int q, l, r;
  scanf("%d", &q);
  while (q--) {
    scanf("%d%d", &l, &r);
    printf("%s\n", can(l, r) ? "Yes" : "No");
  }
}
