#include <bits/stdc++.h>
using namespace std;
const int maX = 1e5 + 8;
string x;
int q, l, r;
int a[maX][3], b[3];
int main() {
  cin >> x >> q;
  memset(a, 0, sizeof(a));
  for (int i = 0; i < x.size(); i++) {
    a[i + 1][0] = a[i][0];
    a[i + 1][1] = a[i][1];
    a[i + 1][2] = a[i][2];
    if (x[i] == 'x')
      a[i + 1][0]++;
    else if (x[i] == 'y')
      a[i + 1][1]++;
    else
      a[i + 1][2]++;
  }
  while (q--) {
    cin >> l >> r;
    if (r - l + 1 <= 2)
      puts("YES");
    else {
      for (int i = 0; i < 3; i++) {
        b[i] = a[r][i] - a[l - 1][i];
      }
      int g = max(b[0], max(b[1], b[2]));
      if (g - 1 <= b[0] && g - 1 <= b[1] && g - 1 <= b[2])
        puts("YES");
      else
        puts("NO");
    }
  }
  return 0;
}
