#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b, long long m) {
  a %= m;
  long long ret = 1;
  while (b) {
    if (b & 1) ret = ((ret % m) * (a % m)) % m;
    a = ((a % m) * (a % m)) % m;
    b >>= 1;
  }
  return ret;
}
string s;
int SZ;
struct segment_tree {
  int seg[4 * 100001][3];
  void build(int idx, int lo, int hi) {
    if (lo == hi) {
      seg[idx][0] = seg[idx][1] = seg[idx][2] = 0;
      seg[idx][s[lo - 1] - 'x'] = 1;
    } else {
      int mid = (lo + hi) >> 1;
      build(2 * idx, lo, mid);
      build(2 * idx + 1, mid + 1, hi);
      seg[idx][0] = seg[2 * idx][0] + seg[2 * idx + 1][0];
      seg[idx][1] = seg[2 * idx][1] + seg[2 * idx + 1][1];
      seg[idx][2] = seg[2 * idx][2] + seg[2 * idx + 1][2];
    }
  }
  int query(int idx, int lo, int hi, int l, int r, int mode) {
    if (lo > r || hi < l) return 0;
    if (lo >= l && hi <= r) return seg[idx][mode];
    int mid = (lo + hi) >> 1;
    return query(2 * idx, lo, mid, l, r, mode) +
           query(2 * idx + 1, mid + 1, hi, l, r, mode);
  }
} tree;
int main() {
  cin >> s;
  SZ = s.size();
  tree.build(1, 1, SZ);
  int m;
  cin >> m;
  while (m--) {
    int l, r;
    cin >> l >> r;
    if ((r - l + 1) < 3) {
      cout << "YES" << endl;
      continue;
    }
    int x = tree.query(1, 1, SZ, l, r, 0);
    int y = tree.query(1, 1, SZ, l, r, 1);
    int z = tree.query(1, 1, SZ, l, r, 2);
    set<int> se;
    se.insert(x);
    se.insert(y);
    se.insert(z);
    if (se.size() == 1 || se.size() == 2) {
      if (se.size() == 2) {
        auto it = se.begin();
        int p = *it;
        it++;
        int q = *it;
        if (abs(p - q) == 1)
          cout << "YES" << endl;
        else
          cout << "NO" << endl;
      } else
        cout << "YES" << endl;
    } else
      cout << "NO" << endl;
  }
  return 0;
}
