#include <bits/stdc++.h>
using namespace std;
char a[200005];
int b[200005][30], c[30], d[30];
int main() {
  scanf("%s", &a);
  int n = strlen(a);
  int w = a[0] - 'a';
  b[0][w] = 1;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < 26; j++) b[i][j] = b[i - 1][j];
    w = a[i] - 'a';
    b[i][w]++;
  }
  int t;
  scanf("%d", &t);
  while (t--) {
    int l, r;
    scanf("%d%d", &l, &r);
    l--;
    r--;
    if (l == r || a[l] != a[r]) {
      printf("Yes\n");
      continue;
    }
    int ans = 0;
    if (l == 0) {
      for (int i = 0; i < 26; i++) {
        if (b[r][i] > 0) ans++;
      }
    } else {
      for (int i = 0; i < 26; i++) {
        if (b[r][i] - b[l - 1][i] > 0) ans++;
      }
    }
    if (ans >= 3)
      printf("Yes\n");
    else
      printf("No\n");
  }
}
