#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e6 + 10;
const long long inf = 0x7ffffffffff;
const long long NINF = -inf;
const long long mod = 1e9 + 7;
template <class T>
inline void read(T &res) {
  char c;
  T flag = 1;
  while ((c = getchar()) < '0' || c > '9')
    if (c == '-') flag = -1;
  res = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') res = res * 10 + c - '0';
  res *= flag;
}
long long t;
int prime[maxn];
bool is_pri[maxn];
int sieve(long long n) {
  int p = 0;
  for (int i = 0; i <= n; i++) is_pri[i] = true;
  is_pri[0] = is_pri[1] = false;
  for (int i = 2; i <= n; i++) {
    if (is_pri[i]) {
      prime[++p] = i;
      for (int j = 2 * i; j <= n; j += i) is_pri[j] = false;
    }
  }
  is_pri[1] = true;
  return p;
}
int sum[maxn][26];
int main() {
  string s;
  cin >> s;
  for (int i = 0; i < 26; ++i) {
    for (int j = 0; j < s.size(); ++j) {
      sum[j + 1][i] = sum[j][i] + (s[j] - 'a' == i);
    }
  }
  int q;
  cin >> q;
  for (int i = 0; i < q; ++i) {
    int l, r;
    cin >> l >> r;
    if (l == r) {
      cout << "Yes\n";
      continue;
    }
    int cnt = 0;
    for (int j = 0; j < 26; ++j) {
      int t = sum[r][j] - sum[l - 1][j];
      if (t > 0) {
        cnt++;
      }
    }
    if (cnt == 1)
      cout << "No\n";
    else if (cnt == 2) {
      if (s[l - 1] != s[r - 1]) {
        cout << "Yes\n";
      } else
        cout << "No\n";
    } else
      cout << "Yes\n";
  }
}
