#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 2e9;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  s = '*' + s;
  int cnt[((int)(s).size())][26];
  for (int(i) = (1); (i) <= (((int)(s).size()) - 1); (i)++) {
    for (int(j) = (0); (j) <= (25); (j)++) cnt[i][j] = cnt[i - 1][j];
    cnt[i][s[i] - 'a']++;
  }
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    if (s[l] != s[r] || l == r) {
      cout << "Yes\n";
      continue;
    }
    int num = 0;
    for (int i = 0; i < 26; i++) {
      if (cnt[r][i] - cnt[l - 1][i] > 0) num++;
    }
    if (num >= 3)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
