#include <bits/stdc++.h>
using namespace std;
char s[410000];
int sum[410000][26];
int q;
int x, y;
set<int> st;
int main() {
  cin >> s;
  st.insert(1);
  int len = strlen(s);
  for (int i = 1; i <= len; i++)
    for (int j = 0; j < 26; j++)
      sum[i][j] = sum[i - 1][j] + (s[i - 1] == (j + 'a'));
  cin >> q;
  while (q--) {
    scanf("%d%d", &x, &y);
    if (y == x) {
      cout << "Yes" << endl;
      continue;
    }
    int tmp[26];
    vector<int> v;
    for (int i = 0; i < 26; i++) {
      tmp[i] = sum[y][i] - sum[x - 1][i];
      if (tmp[i]) v.push_back(tmp[i]);
    }
    if (v.size() == 1) {
      cout << "No" << endl;
      continue;
    }
    if (v.size() == 2 && s[x - 1] == s[y - 1]) {
      cout << "No" << endl;
      continue;
    }
    cout << "Yes" << endl;
  }
  return ~~(0 ^ 0 ^ 0);
}
