#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10, mod = 1e9 + 7;
int cnt[N][26];
int get(int l, int r) {
  int ret = 0;
  for (int i = 0; i < 26; i++) {
    int rem = 0;
    if (l) rem = cnt[l - 1][i];
    ret += ((cnt[r][i] - rem) > 0);
  }
  return ret;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int n = s.length();
  cnt[0][s[0] - 'a'] = 1;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < 26; j++) cnt[i][j] = cnt[i - 1][j];
    cnt[i][s[i] - 'a']++;
  }
  int q;
  cin >> q;
  while (q--) {
    int lef, rig;
    cin >> lef >> rig;
    lef--;
    rig--;
    if (lef == rig || s[lef] != s[rig] || get(lef, rig) > 2)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
