#include <bits/stdc++.h>
using namespace std;
long long mod1 = 998244353;
long long mod = 1e9 + 7;
long long mod2 = 1e17 + 3;
const long long N = 2e5 + 12;
string s;
int n, q;
int l, r;
int v[N][26];
void solve() {
  cin >> s >> q;
  n = (long long)s.size();
  for (int i = 1; i < n + 1; i++) {
    v[i][s[i - 1] - 'a']++;
    for (int j = 0; j < 26; j++) v[i][j] += v[i - 1][j];
  }
  while (q--) {
    cin >> l >> r;
    l--;
    int c = 0;
    for (int i = 0; i < 26; i++)
      if (v[r][i] - v[l][i]) c++;
    if (c > 2) {
      cout << "Yes";
    } else if (c == 1) {
      if (r - l == 1)
        cout << "Yes";
      else
        cout << "No";
    } else if (s[l] == s[r - 1])
      cout << "No";
    else
      cout << "Yes";
    cout << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
