#include <bits/stdc++.h>
using namespace std;
const long long N = 3501;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  string s;
  cin >> s;
  long long q;
  cin >> q;
  long long n = s.length();
  long long f[n + 1][26];
  for (long long i = 0; i <= n; i++) {
    for (long long j = 0; j < 26; j++) f[i][j] = 0;
  }
  f[1][s[0] - 'a']++;
  for (long long i = 2; i <= n; i++) {
    for (long long j = 0; j < 26; j++) {
      f[i][j] = f[i - 1][j];
    }
    f[i][s[i - 1] - 'a']++;
  }
  while (q--) {
    long long l, r;
    cin >> l >> r;
    long long cnt = 0;
    for (long long j = 0; j < 26; j++) {
      if (f[r][j] - f[l - 1][j] > 0) cnt++;
    }
    if (s[l - 1] != s[r - 1] || l == r || cnt > 2) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  }
}
