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