#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
char s[maxn];
int n, q, l, r;
int e3[maxn];
int t[27], k = 0;
int main() {
  memset(e3, -1, sizeof(e3));
  scanf("%s", s);
  n = strlen(s);
  for (int i = 0, j = 0; i < n;) {
    for (; j < n && k <= 2; j++) {
      if (t[s[j] - 'a'] == 0 && k == 2) e3[i] = j;
      if (t[s[j] - 'a']++ == 0) k++;
    }
    if (k <= 2) break;
    for (; k >= 3; i++) {
      if (t[s[i] - 'a'] > 1) e3[i + 1] = e3[i];
      if (--t[s[i] - 'a'] == 0) k--;
    }
  }
  cin >> q;
  for (int c = 1; c <= q; c++) {
    cin >> l >> r;
    l--, r--;
    if (l == r || s[l] != s[r])
      printf("Yes\n");
    else {
      if (e3[l] != -1 && r >= e3[l])
        printf("Yes\n");
      else
        printf("No\n");
    }
  }
}
