#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 2e5 + 5;
int cnt[maxn][30];
char s[maxn];
int arrcy[30];
int main() {
  memset(cnt, 0, sizeof cnt);
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> (s + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= n; i++) {
    for (int k = 0; k < 26; k++) cnt[i][k] = cnt[i - 1][k];
    cnt[i][s[i] - 'a']++;
  }
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    if (r == l) {
      cout << "Yes\n";
      continue;
    }
    int num = 0, a;
    for (int i = 0; i < 26; i++) {
      arrcy[i] = cnt[r][i] - cnt[l - 1][i];
      if (arrcy[i]) {
        if (num == 0) a = i;
        num++;
      }
    }
    if (num >= 3) {
      cout << "Yes\n";
      continue;
    } else if (num == 1) {
      cout << "No\n";
      continue;
    } else {
      if (s[l] != s[r])
        cout << "Yes\n";
      else
        cout << "No\n";
    }
  }
  return 0;
}
