#include <bits/stdc++.h>
const double pi =
    3.141592653589793238462643383279502884197169399375105820974944;
using namespace std;
long long n, i, j, k, l, sum = 0, flag = 0, ans = 0, a[3][100005] = {0}, q, r;
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  n = s.size();
  for (i = 0; i < n; i++) {
    a[s[i] - 'x'][i + 1]++;
  }
  for (i = 0; i < 3; i++) {
    for (j = 1; j <= n; j++) {
      a[i][j] += a[i][j - 1];
    }
  }
  cin >> q;
  while (q--) {
    cin >> l >> r;
    set<long long> st;
    long long first, second, z;
    first = a[0][r] - a[0][l - 1];
    second = a[1][r] - a[1][l - 1];
    z = a[2][r] - a[2][l - 1];
    long long k = min({first, second, z});
    first -= k;
    second -= k;
    z -= k;
    if (max({first, second, z}) > 1 && !(r - l + 1 < 3))
      cout << "NO\n";
    else
      cout << "YES\n";
  }
  return 0;
}
