#include <bits/stdc++.h>
using namespace std;
char str[200005];
int pre[200005][30] = {0};
int main() {
  int i, j, q, l, r;
  scanf(" %s%d", str, &q);
  for (i = 0; str[i]; i++) pre[i][str[i] - 'a']++;
  for (i = 1; str[i]; i++)
    for (j = 0; j < 26; j++) pre[i][j] = pre[i][j] + pre[i - 1][j];
  while (q--) {
    scanf("%d%d", &l, &r);
    l--;
    r--;
    if (l == r || str[l] != str[r]) {
      puts("Yes");
      continue;
    }
    int cnt = 0;
    for (i = 0; i < 26; i++)
      if (pre[r][i] - (l ? pre[l - 1][i] : 0) > 0) cnt++;
    if (cnt >= 3)
      puts("Yes");
    else
      puts("No");
  }
}
