#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
const int IMAX = 200500;
const int V = 2100;
const long long LMAX = 1000000000000000001;
int R[] = {-1, 0, 1, 0};
int C[] = {0, 1, 0, -1};
void solve(int test) {
  string s;
  cin >> s;
  int n = s.length(), i, l, r, cnt;
  vector<vector<int>> dp(n + 1, vector<int>(26, 0));
  for (i = 1; i <= n; i++) {
    dp[i] = dp[i - 1];
    dp[i][s[i - 1] - 'a']++;
  }
  int q;
  cin >> q;
  while (q--) {
    cin >> l >> r;
    if (l == r) {
      cout << "YES\n";
      continue;
    }
    cnt = 0;
    for (i = 0; i < 26; i++) {
      if (dp[r][i] - dp[l - 1][i] > 0) cnt++;
    }
    if (cnt >= 3)
      cout << "YES\n";
    else if (cnt == 2 && s[l - 1] != s[r - 1])
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  for (int i = 1; i <= t; i++) solve(i);
}
