#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(47498234);
const long long MOD = 998244353ll;
const long long MOD1 = 1e9 + 7;
const int MAXN = 200001;
const int MAXM = 26;
int cnt[MAXN][MAXM];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cout << fixed << setprecision(20);
  string s;
  cin >> s;
  int n = s.length();
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < MAXM; j++) {
      cnt[i + 1][j] = cnt[i][j];
    }
    cnt[i + 1][s[i] - 'a']++;
  }
  int q;
  cin >> q;
  for (int tt = 0; tt < q; tt++) {
    int l, r;
    cin >> l >> r;
    int c = 0;
    for (int i = 0; i < MAXM; i++) {
      if (cnt[r][i] - cnt[l - 1][i] > 0) {
        c++;
      }
    }
    if (c == 1) {
      if (l == r) {
        cout << "Yes\n";
      } else {
        cout << "No\n";
      }
      continue;
    }
    if (c == 2) {
      if (s[l - 1] != s[r - 1]) {
        cout << "Yes\n";
      } else {
        cout << "No\n";
      }
      continue;
    }
    cout << "Yes\n";
  }
  return 0;
}
