#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int N = S.length();
  vector<vector<int> > alpha_sum(N + 1);
  for (int(i) = 0; (i) < (N + 1); (i)++) {
    alpha_sum[i].resize(26, 0);
  }
  for (int(i) = 0; (i) < (N); (i)++) {
    alpha_sum[i + 1] = alpha_sum[i];
    alpha_sum[i + 1][(int)S[i] - (int)'a']++;
  }
  int T;
  cin >> T;
  for (int(t) = 0; (t) < (T); (t)++) {
    int l, r;
    cin >> l >> r;
    string ans = "Yes";
    if (l != r) {
      int alnum = 0;
      for (int(b) = 0; (b) < (26); (b)++) {
        if (alpha_sum[r][b] != alpha_sum[l - 1][b]) alnum++;
      }
      if (alnum == 1)
        ans = "No";
      else if (alnum == 2) {
        if (S[l - 1] == S[r - 1]) ans = "No";
      }
    }
    cout << ans << endl;
  }
  return 0;
}
