#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int i, j, k, n, m, p, q, t, T, l, r,
      mx = -INT_MAX, mn = INT_MAX, ans = 0, sum = 0, ct = 0, flag = 0;
  string s;
  cin >> s;
  n = s.length();
  std::vector<vector<long long int> > v(n + 1, vector<long long int>(26));
  for (i = 1; i <= n; i++) {
    for (j = 0; j < 26; j++) {
      if (s[i - 1] - 97 == j)
        v[i][j] = v[i - 1][j] + 1;
      else
        v[i][j] = v[i - 1][j];
    }
  }
  cin >> q;
  while (q--) {
    cin >> l >> r;
    if (r - l == 0) {
      cout << "Yes\n";
      continue;
    }
    if (s[l - 1] != s[r - 1]) {
      cout << "Yes\n";
      continue;
    }
    if (r - l + 1 < 4) {
      cout << "No\n";
      continue;
    }
    ct = 0;
    for (i = 0; i < 26; i++) {
      if (v[r][i] - v[l - 1][i] > 0) ct++;
    }
    if (ct >= 3)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
