#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
int64_t p[202000][26];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  for (int64_t i = 0; i < s.size(); i++) {
    if (i)
      for (int64_t j = 0; j < 26; j++) p[i][j] = p[i - 1][j];
    p[i][s[i] - 'a']++;
  }
  int64_t q;
  cin >> q;
  while (q--) {
    int64_t l, r;
    cin >> l >> r;
    l--;
    r--;
    int64_t d = 0;
    for (int64_t i = 0; i < 26; i++)
      d += ((p[r][i] - (l == 0 ? 0 : p[l - 1][i])) != 0);
    if (r - l == 0 || d >= 3 || s[l] != s[r])
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
