#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  int n = s.size();
  vector<vector<int>> pre(n + 1, vector<int>(26, 0));
  for (int i = 1; i <= n; ++i)
    for (int j = 0; j < 26; ++j)
      pre[i][j] = pre[i - 1][j] + (s[i - 1] - 'a' == j);
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    vector<int> cnt(26, 0);
    for (int i = 0; i < 26; ++i) cnt[i] = pre[r][i] - pre[l - 1][i];
    int c = 0;
    for (int i = 0; i < 26; ++i) c += (cnt[i] > 0);
    if (c > 2 || s[r - 1] != s[l - 1])
      cout << "Yes\n";
    else if (l == r)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
