#include <bits/stdc++.h>
using namespace std;
char ch[100100];
int n, m, sum1[100100], sum2[100100], sum3[100100];
int main() {
  scanf("%s %d", ch + 1, &m);
  n = strlen(ch + 1);
  for (int i = 1; i <= n; i++) {
    sum1[i] = sum1[i - 1] + (ch[i] == 'x');
    sum2[i] = sum2[i - 1] + (ch[i] == 'y');
    sum3[i] = sum3[i - 1] + (ch[i] == 'z');
  }
  int l, r;
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &l, &r);
    if (r - l + 1 < 3) {
      printf("YES\n");
      continue;
    }
    int M1 = sum1[r] - sum1[l - 1], M2 = M1;
    M1 = min(sum2[r] - sum2[l - 1], M1);
    M1 = min(sum3[r] - sum3[l - 1], M1);
    M2 = max(sum2[r] - sum2[l - 1], M2);
    M2 = max(sum3[r] - sum3[l - 1], M2);
    if (M2 - M1 > 1)
      printf("NO\n");
    else
      printf("YES\n");
  }
}
