#include <bits/stdc++.h>
const int mod = 998244353;
using namespace std;
int a[400000];
int n, m, k;
int num[400000][30], sum[400000][30];
string s;
int sol(int l, int r) {
  if (l == r) {
    return 1;
  }
  int ct = 0;
  for (int i = 0; i < 26; ++i) {
    int t = sum[r][i] - sum[l - 1][i];
    if (t > 0) {
      ct++;
    }
  }
  return ct > 2 || (ct == 2 && (s[l - 1] != s[r - 1]));
}
int main() {
  memset(sum, 0, sizeof(sum));
  memset(num, 0, sizeof(num));
  cin >> s;
  for (int i = 0; i < s.size(); ++i) {
    num[i][s[i] - 'a']++;
    if (i == 0) {
      for (int j = 0; j < 26; ++j) {
        sum[i + 1][j] = num[i][j];
      }
    } else {
      for (int j = 0; j < 26; ++j) {
        sum[i + 1][j] = num[i][j] + sum[i][j];
      }
    }
  }
  int t;
  cin >> t;
  while (t--) {
    int l, r;
    cin >> l >> r;
    if (sol(l, r)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
