#include <bits/stdc++.h>
#pragma GCC optimize("-O2")
using namespace std;
const int N = 2e5 + 5, MOD = 1e9 + 7;
const long double EPS = 1e-9;
int f[N][26];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  int i, j, n = s.length();
  for (i = 0; i < n; i++) {
    for (j = 0; j < 26; j++)
      if (i > 0) f[i][j] = f[i - 1][j];
    f[i][s[i] - 'a']++;
  }
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    l--;
    r--;
    bool ok = false;
    if (r == l) ok = true;
    int fr[26] = {};
    for (i = 0; i < 26; i++) {
      fr[i] = f[r][i];
      if (l > 0) fr[i] -= f[l - 1][i];
    }
    int cnt = 0;
    for (i = 0; i < 26; i++)
      if (fr[i]) cnt++;
    if (cnt >= 3) ok = true;
    if (cnt == 2 and s[l] != s[r]) ok = true;
    if (ok)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
