#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  int n;
  n = str.size();
  int arr[27][n + 1];
  for (int i = 0; i < 27; i++) {
    arr[i][0] = 0;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 27; j++) {
      arr[j][i] = arr[j][i - 1];
    }
    int pos = str[i - 1] - 'a' + 1;
    arr[pos][i]++;
  }
  int q;
  cin >> q;
  while (q) {
    int l, r;
    cin >> l >> r;
    if (l == r) {
      cout << "Yes\n";
    } else {
      int cnt = 0;
      for (int i = 0; i < 27; i++) {
        int num = arr[i][r] - arr[i][l - 1];
        if (num >= 1) {
          cnt++;
        }
      }
      if (str[l - 1] != str[r - 1] || cnt >= 3) {
        cout << "Yes\n";
      } else {
        cout << "No\n";
      }
    }
    q--;
  }
  return 0;
}
