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