#include <bits/stdc++.h>
long long powermod(long long _a, long long _b, long long _m) {
  long long _r = 1;
  while (_b) {
    if (_b % 2 == 1) _r = (_r * _a) % _m;
    _b /= 2;
    _a = (_a * _a) % _m;
  }
  return _r;
}
using namespace std;
template <typename T>
void pr(const T& t) {
  cout << t << "\n";
}
template <typename T, typename U, typename... ARGS>
void pr(const T& t, const U& u, const ARGS&... args) {
  cout << t << " ";
  pr(u, args...);
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  string s;
  cin >> s;
  ;
  long long n = s.size();
  long long arr[n][26];
  memset(arr, 0, sizeof(arr));
  for (long long i = 0; i < n; ++i) {
    arr[i][s[i] - 'a']++;
    if (i > 0)
      for (long long j = 0; j < 26; ++j) {
        arr[i][j] += arr[i - 1][j];
      }
  }
  long long tt;
  cin >> tt;
  while (tt--) {
    long long a, b;
    cin >> a >> b;
    ;
    a--, b--;
    long long ans = 0;
    for (long long j = 0; j < 26; ++j)
      if (arr[a][j] != arr[b][j]) ans++;
    if (s[a] != s[b] || b == a || ans > 2)
      pr("Yes");
    else
      pr("No");
  }
}
