#include <bits/stdc++.h>
using namespace std;
void Main();
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  while (~cin.peek()) Main(), cin.get();
  return 0;
}
void Main() {
  string s;
  cin >> s;
  int n = s.size();
  s = " " + s;
  vector<vector<int>> a(n + 1, vector<int>(26));
  for (int i = 1; i <= n; i++) {
    a[i] = a[i - 1];
    a[i][s[i] - 'a']++;
  }
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    auto count = [&](int l, int r) {
      int cnt = 0;
      for (int i = 0; i < 26; i++) cnt += a[r][i] - a[l - 1][i] > 0;
      return cnt;
    };
    if (l == r || s[l] != s[r] || count(l, r) >= 3)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
