#include <bits/stdc++.h>
using namespace std;
int const N = 2e5;
set<char> tree[4 * N + 7];
int n;
void build(const string &s, int node = 1, int tl = 0, int tr = n - 1) {
  if (tl == tr) return void(tree[node].insert(s[tl]));
  int mid = (tl + tr) / 2;
  build(s, node * 2, tl, mid);
  build(s, node * 2 + 1, mid + 1, tr);
  for (auto x : tree[node * 2]) tree[node].insert(x);
  for (auto x : tree[node * 2 + 1]) tree[node].insert(x);
}
void query(set<char> &res, int l, int r, int node = 1, int tl = 0,
           int tr = n - 1) {
  if (l > r) return;
  if (tl == l && tr == r) {
    res.insert(tree[node].begin(), tree[node].end());
    return;
  }
  int mid = (tl + tr) / 2;
  query(res, l, min(r, mid), node * 2, tl, mid);
  query(res, max(l, mid + 1), r, node * 2 + 1, mid + 1, tr);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  n = (int)s.size();
  build(s);
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    l--;
    r--;
    set<char> st;
    query(st, l, r);
    if (l == r)
      cout << "Yes" << '\n';
    else if (st.size() == 1)
      cout << "No" << '\n';
    else if (st.size() == 2 && s[l] == s[r])
      cout << "No" << '\n';
    else
      cout << "Yes" << '\n';
  }
  return 0;
}
