#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  int n = str.length();
  int q;
  cin >> q;
  vector<int> pre[26];
  for (int i = 0; i < 26; i++) {
    pre[i].push_back(0);
    for (int j = 0; j < n; j++) {
      pre[i].push_back(pre[i].back() + (str[j] == i + 'a'));
    }
  }
  while (q--) {
    int l, r;
    cin >> l >> r;
    int len = r - l + 1;
    int cnt = 0;
    for (auto &v : pre) {
      if (v[r] - v[l - 1]) {
        cnt++;
      }
    }
    if (str[l - 1] != str[r - 1] or cnt > 2 or len == 1)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
