#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:36777216")
using namespace std;
const int nax = (int)2e5 + 5;
int cnt[nax][26];
int cur[26];
int dp[nax];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.precision(20);
  cout.setf(ios::fixed);
  string s;
  cin >> s;
  int n = (int)s.size();
  for (int i = 0; i < n; i++) {
    cnt[i][s[i] - 'a']++;
    dp[i] = 1;
    if (i && s[i] == s[i - 1]) {
      dp[i] += dp[i - 1];
    }
    for (int j = 0; j < 26; j++) {
      if (i) {
        cnt[i][j] += cnt[i - 1][j];
      }
    }
  }
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    l--, r--;
    if (l == r) {
      puts("Yes");
      continue;
    }
    int have = 0;
    for (int i = 0; i < 26; i++) {
      cur[i] = cnt[r][i];
      if (l - 1 >= 0) cur[i] -= cnt[l - 1][i];
      if (cur[i]) have++;
    }
    if (have == 1) {
      puts("No");
    } else if (have > 2) {
      puts("Yes");
    } else {
      int ok = 0;
      int tmp = dp[r];
      for (int i = 0; i < 26; i++) {
        if (s[r] - 'a' == i) {
          if (tmp == cur[i]) ok = 1;
        }
      }
      if (s[l] != s[r])
        puts("Yes");
      else
        puts("No");
    }
  }
  return 0;
}
