#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
const int MOD = (int)1e9 + 7;
void __print() { cerr << "]\n"; }
template <typename T, typename... V>
void __print(T t, V... v) {
  cerr << t;
  if (sizeof...(v)) cerr << ", ";
  __print(v...);
}
int main() {
  string s;
  cin >> s;
  s = '#' + s;
  int len = s.length();
  int qsum[len + 1][30];
  memset(qsum, 0, sizeof qsum);
  for (int i = 1; i < len; i++) {
    qsum[i][s[i] - 'a']++;
    for (int j = 0; j < 26; j++) {
      qsum[i][j] += qsum[i - 1][j];
    }
  }
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    if (l == r)
      puts("Yes");
    else {
      l--;
      int c = 0;
      for (int i = 0; i <= 25; i++) {
        if (qsum[l][i] != qsum[r][i]) {
          c++;
        }
      }
      if (c > 2)
        puts("Yes");
      else {
        if (s[l + 1] == s[r]) {
          puts("No");
        } else {
          puts("Yes");
        }
      }
    }
  }
}
