#include <bits/stdc++.h>
using namespace std;
const int N = 300010;
int dp[N][26];
int main() {
  string s;
  cin >> s;
  int n = s.size();
  s = ' ' + s;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 26; j++) dp[i][j] = dp[i - 1][j];
    dp[i][s[i] - 'a']++;
  }
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    bool flag = 0;
    if (l == r || s[l] != s[r]) flag = 1;
    int cnt = 0;
    for (int i = 0; i < 26; i++)
      if (dp[r][i] - dp[l - 1][i] > 0) cnt++;
    if (cnt >= 3) flag = 1;
    if (flag)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
