#include <bits/stdc++.h>
using namespace std;
const int mods = 1e9 + 7;
const int maxn = 2e5 + 10;
const int N = 1e5 + 10;
const int E = 1e6 + 10;
int q;
string s;
int cnt[maxn][30];
void solve(string s) {
  for (int i = 1; i <= s.size(); i++) {
    for (int j = 0; j < 26; j++) cnt[i][j] = cnt[i - 1][j];
    cnt[i][s[i - 1] - 'a'] = cnt[i - 1][s[i - 1] - 'a'] + 1;
  }
}
int main() {
  cin >> s;
  cin >> q;
  solve(s);
  int l, r, num, flg;
  while (q--) {
    cin >> l >> r;
    if (l == r) {
      printf("Yes\n");
      continue;
    }
    num = 0;
    flg = 0;
    if (s[l - 1] != s[r - 1]) {
      flg = 1;
    } else {
      for (int i = 0; i < 26; i++) {
        if (cnt[r][i] - cnt[l - 1][i]) num++;
        if (num >= 3) {
          flg = 1;
          break;
        }
      }
    }
    if (flg)
      printf("Yes\n");
    else
      printf("No\n");
  }
}
