#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long MAXN = 4e5 + 228;
void solve() {
  string s;
  cin >> s;
  vector<vector<long long> > pref(26, vector<long long>(s.size() + 2, 0));
  long long n = s.size();
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < 26; ++j) {
      pref[j][i] = (i == 0 ? 0 : pref[j][i - 1]) + (s[i] - 'a' == j);
    }
  }
  long long q;
  cin >> q;
  while (q--) {
    long long l, r;
    cin >> l >> r;
    l--, r--;
    if (r == l) {
      cout << "Yes\n";
      continue;
    }
    multiset<long long> st;
    for (int i = 0; i < 26; ++i) {
      long long kek = pref[i][r] - (l == 0 ? 0 : pref[i][l - 1]);
      if (kek != 0) st.insert(kek);
    }
    if (st.size() == 1) {
      cout << "No\n";
      continue;
    }
    if (s[l] == s[r]) {
      if (st.size() > 2) {
        cout << "Yes\n";
      } else {
        cout << "No\n";
      }
    } else {
      cout << "Yes\n";
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long test = 1;
  while (test--) {
    solve();
  }
  return 0;
}
