#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 3;
int n, q, sum[26][N];
char s[N];
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  scanf("%d", &q);
  for (int i = 0; i < 26; i++)
    for (int j = 1; j <= n; j++) sum[i][j] = sum[i][j - 1] + (s[j] - 'a' == i);
  for (int i = 1; i <= q; i++) {
    int l, r;
    scanf("%d %d", &l, &r);
    if (l == r || s[l] != s[r]) {
      puts("Yes");
      continue;
    }
    int cnt = 0;
    for (int i = 0; i < 26; i++) cnt += (sum[i][r] - sum[i][l - 1] > 0);
    if (cnt >= 3)
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
