#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  char c[n + 1];
  for (int i = 1; i <= n; i++) c[i] = s[i - 1];
  int pre[n + 1][30];
  for (int i = 0; i < 30; i++) pre[0][i] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 30; j++) {
      pre[i][j] = pre[i - 1][j];
    }
    pre[i][c[i] - 'a'] += 1;
  }
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    if (r == l) {
      cout << "Yes\n";
      continue;
    }
    if (c[l] != c[r]) {
      cout << "Yes\n";
      continue;
    }
    int cnt = 0;
    for (int i = 0; i < 30; i++) {
      cnt += (pre[r][i] - pre[l - 1][i] > 0);
    }
    cnt > 2 ? cout << "Yes\n" : cout << "No\n";
  }
  return 0;
}
