#include <bits/stdc++.h>
using namespace std;
using namespace std;
long long int alp[200005][26];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int T = 1;
  for (long long int qq = 1; qq <= T; qq++) {
    string s;
    cin >> s;
    for (int i = 0; i < s.size(); i++) {
      for (int j = 0; j < 26; j++) {
        alp[i + 1][j] = alp[i][j] + (j + 'a' == s[i]);
      }
    }
    long long int n;
    cin >> n;
    while (n--) {
      long long int a, b;
      cin >> a >> b;
      if (b - a == 0)
        cout << "Yes" << endl;
      else {
        long long int x = 0;
        for (int i = 0; i < 26; i++) x += (alp[b][i] - alp[a - 1][i] > 0);
        if (x == 2 && s[a - 1] == s[b - 1] || x == 1)
          cout << "No" << endl;
        else
          cout << "Yes" << endl;
      }
    }
  }
  return 0;
}
