#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  int n = s.length();
  int arr[n + 1][26];
  for (int j = 0; j < 26; j++) arr[0][j] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 26; j++) arr[i][j] = arr[i - 1][j];
    arr[i][s[i - 1] - 'a']++;
  }
  int a[26];
  int q;
  cin >> q;
  int l, r;
  while (q--) {
    cin >> l >> r;
    if (l == r) {
      cout << "Yes\n";
      continue;
    }
    if (s[l - 1] != s[r - 1]) {
      cout << "Yes\n";
      continue;
    }
    if (r == l + 1) {
      cout << "No\n";
      continue;
    }
    l--;
    r--;
    for (int i = 0; i < 26; i++) a[i] = arr[r + 1][i] - arr[l][i];
    int flag = 0;
    for (int i = 0; i < 26; i++) {
      if (a[i] != 0) {
        flag++;
      }
    }
    if (flag <= 2) {
      cout << "No\n";
    } else {
      cout << "Yes\n";
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) solve();
}
