#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
char str[maxn];
int a[maxn][30];
int main() {
  memset(a, 0, sizeof(a));
  cin >> (str + 1);
  int n = strlen(str + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 26; j++) a[i][j] = a[i - 1][j];
    a[i][str[i] - 'a']++;
  }
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    int x = 0;
    for (int i = 0; i < 26; i++) {
      if (a[r][i] - a[l - 1][i] > 0) x++;
    }
    if (l == r)
      cout << "Yes" << endl;
    else if (str[l] != str[r])
      cout << "Yes" << endl;
    else if (x >= 3)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
