#include <bits/stdc++.h>
using namespace std;
const long long N = 200200;
string s;
long long n;
long long a[26][N];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  n = s.size();
  for (long long i = 0; i < n; i++) {
    a[s[i] - 'a'][i + 1]++;
  }
  for (long long i = 0; i < 26; i++) {
    for (long long j = 1; j < N; j++) {
      a[i][j] += a[i][j - 1];
    }
  }
  long long q;
  cin >> q;
  while (q--) {
    long long l, r;
    cin >> l >> r;
    if (r - l + 1 == 1 || s[l - 1] != s[r - 1]) {
      cout << "Yes"
           << "\n";
    } else {
      long long cnt = 0;
      for (long long i = 0; i < 26; i++) {
        cnt += (a[i][r] - a[i][l - 1] > 0);
      }
      cout << (cnt > 2 ? "Yes" : "No") << "\n";
    }
  }
  return 0;
}
