#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int p[26][N];
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  s = '$' + s;
  for (int c = 0; c < 26; c++) {
    for (int i = 1; i <= n; i++) {
      p[c][i] = p[c][i - 1] + (s[i] - 'a' == c);
    }
  }
  int q, l, r;
  cin >> q;
  while (q--) {
    cin >> l >> r;
    int cnt = 0;
    for (int c = 0; c < 26; c++) {
      cnt += (p[c][r] - p[c][l - 1] > 0);
    }
    if (cnt >= 3) {
      cout << "Yes" << '\n';
      continue;
    }
    if (cnt == 2) {
      if (s[l] == s[r])
        cout << "No" << '\n';
      else
        cout << "Yes" << '\n';
      continue;
    }
    if (l == r)
      cout << "Yes" << '\n';
    else
      cout << "No" << '\n';
  }
  return 0;
}
