#include <bits/stdc++.h>
using namespace std;
const int N = 200100, A = 26;
string s;
int q, n;
int pre[N][A];
int main() {
  cin >> s >> q;
  n = s.size();
  for (int i = 1; i <= n; ++i) {
    ++pre[i][s[i - 1] - 'a'];
    for (int j = 0; j < A; ++j) pre[i][j] += pre[i - 1][j];
  }
  for (int i = 0; i < q; ++i) {
    int a, b;
    cin >> a >> b;
    if (a == b)
      cout << "Yes" << endl;
    else {
      int cnt = 0;
      for (int j = 0; j < A; ++j)
        if (pre[b][j] - pre[a - 1][j] > 0) ++cnt;
      if (cnt > 2 || s[a - 1] != s[b - 1])
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  }
}
