#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long t = 1;
  while (t--) {
    string s;
    cin >> s;
    int i = 0, n = s.length();
    int cnt[n + 1][26];
    while (i < 26) {
      cnt[0][i] = 0;
      i++;
    }
    i = 0;
    while (i < n) {
      for (int k = 0; k < 26; k++) cnt[i + 1][k] = cnt[i][k];
      cnt[i + 1][(int)(s[i] - 'a')]++;
      i++;
    }
    cin >> n;
    while (n--) {
      int l, r;
      cin >> l >> r;
      if (l == r) {
        cout << "Yes" << endl;
        continue;
      }
      if (s[l - 1] == s[r - 1]) {
        i = 0;
        for (int k = 0; k < 26; k++) {
          if (cnt[r][k] > cnt[l - 1][k]) i++;
        }
        if (i >= 3)
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
        continue;
      }
      cout << "Yes" << endl;
    }
  }
  return 0;
}
