#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
bool prime[1000001];
long long f[300005];
long long pow1(long long x, long long y) {
  long long res = 1;
  x = x % mod;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res;
}
long long divide(long long n) { return pow1(n, mod - 2); }
long long ncr(long long n, long long r) {
  if (n < r) return 0;
  return (f[n] * ((divide(f[r]) * divide(f[n - r])) % mod)) % mod;
}
void sieve() {
  memset(prime, true, sizeof(prime));
  for (long long i = 2; i * i <= 1000000; i++)
    if (prime[i])
      for (long long j = i * i; j <= 1000000; j += i) prime[j] = false;
  prime[0] = prime[1] = false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  long long i, n = s.length(), j;
  long long a[n + 2][26];
  memset(a, 0, sizeof(a));
  for (i = 0; i < n; i++) {
    a[i + 1][s[i] - 'a']++;
    for (j = 0; j < 26; j++) a[i + 2][j] = a[i + 1][j];
  }
  long long q;
  cin >> q;
  while (q--) {
    long long l, r, x, cnt = 0;
    cin >> l >> r;
    if (l == r) {
      cout << "Yes" << endl;
      continue;
    }
    for (i = 0; i < 26; i++) {
      x = a[r][i] - a[l - 1][i];
      if (x > 0) cnt++;
    }
    if (cnt == 2 && s[l - 1] != s[r - 1])
      cout << "Yes" << endl;
    else if (cnt > 2)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
