#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
void solve() {
  string str;
  cin >> str;
  int q;
  cin >> q;
  int n = str.size();
  vector<vector<int>> table(n + 1, vector<int>(26, 0));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 26; j++) {
      table[i + 1][j] = table[i][j];
    }
    table[i + 1][str[i] - 'a']++;
  }
  for (int i = 0; i < q; i++) {
    int l, r;
    cin >> l >> r;
    if (l == r || str[l - 1] != str[r - 1]) {
      cout << "Yes" << endl;
      continue;
    }
    int cnt = 0;
    for (int j = 0; j < 26; j++) {
      if (table[r][j] - table[l - 1][j]) cnt++;
    }
    if (cnt > 2) {
      cout << "Yes" << endl;
      continue;
    }
    cout << "No" << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
