#include <bits/stdc++.h>
using namespace std;
string s;
int Ttest, n;
int f[212345][50];
int Left[212345], Right[212345];
int a[212345];
int main() {
  cin >> s;
  n = s.length();
  s = "#" + s + "#";
  for (int i = 1; i <= n; i++) a[i] = int(s[i] - 'a');
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 26; j++) f[i][j] = f[i - 1][j];
    f[i][a[i]]++;
  }
  cin >> Ttest;
  while (Ttest--) {
    int l, r;
    cin >> l >> r;
    bool kt = false;
    if (s[l] != s[r] || l == r)
      kt = true;
    else {
      int dem = 0;
      for (int i = 0; i < 26; i++)
        if (f[r][i] - f[l - 1][i] > 0) dem++;
      if (dem >= 3) kt = true;
    }
    if (kt)
      cout << "Yes";
    else
      cout << "No";
    cout << endl;
  }
}
