#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
string S;
int cnt[200001][26];
int main() {
  cin >> S;
  for (int i = 0; i < S.length(); i++) {
    cnt[i][S[i] - 'a']++;
    if (i > 0)
      for (int j = 0; j < 26; j++) cnt[i][j] += cnt[i - 1][j];
  }
  int Q;
  cin >> Q;
  while (Q--) {
    int l, r;
    cin >> l >> r;
    l--;
    r--;
    if (l == r)
      cout << "Yes" << endl;
    else {
      int dist = 0;
      for (int i = 0; i < 26; i++)
        if ((cnt[r][i] - ((l == 0) ? 0 : cnt[l - 1][i])) > 0) dist++;
      if (S[l] != S[r])
        cout << "Yes" << endl;
      else if (dist >= 3)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  }
  return 0;
}
