#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long power(long long a, long long n) {
  long long res = 1;
  while (n != 0) {
    if (n % 2) {
      res = res * a;
      n--;
    } else {
      a = a * a;
      n = n / 2;
    }
  }
  return res;
}
void solve() {
  string s;
  cin >> s;
  int q;
  cin >> q;
  vector<vector<int>> f(s.length() + 1, vector<int>(26, 0));
  for (int i = 0; i < s.length(); i++) {
    char c = s[i];
    f[i + 1][c - 'a']++;
  }
  for (int j = 0; j < 26; j++) {
    for (int i = 1; i <= s.length(); i++) f[i][j] += f[i - 1][j];
  }
  while (q--) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    int length = b - a + 1;
    string t = s.substr(a, length);
    if (t.length() == 1 || t[0] != t[length - 1])
      cout << "Yes" << '\n';
    else {
      int count = 3;
      for (int j = 0; j < 26; j++) {
        if (f[b + 1][j] - f[a][j] > 0) count--;
      }
      if (count > 0)
        cout << "No" << '\n';
      else
        cout << "Yes" << '\n';
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  while (t--) solve();
}
