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