#include <bits/stdc++.h>
using namespace std;
int fre[200004][26];
int main() {
  int q, l, r;
  string str;
  cin >> str;
  int n = str.length();
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < 26; ++j) {
      if (str[i] - 'a' == j)
        fre[i + 1][j] = fre[i][j] + 1;
      else
        fre[i + 1][j] = fre[i][j];
    }
  }
  cin >> q;
  while (q--) {
    cin >> l >> r;
    if (l == r)
      printf("Yes\n");
    else {
      int cnt = 0;
      for (int i = 0; i < 26; ++i) {
        if (fre[r][i] - fre[l - 1][i] > 0) cnt++;
      }
      if (cnt > 2)
        printf("Yes\n");
      else if (cnt == 1)
        printf("No\n");
      else if (str[l - 1] == str[r - 1])
        printf("No\n");
      else
        printf("Yes\n");
    }
  }
  return 0;
}
