#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
char in1[N];
int coun1[27][N];
int main(void) {
  cin >> in1;
  int len1 = strlen(in1);
  for (int i = 0; i < len1; ++i) {
    for (int j = 1; j <= 26; ++j) {
      if (in1[i] == j + 96)
        coun1[j][i] = coun1[j][i - 1] + 1;
      else
        coun1[j][i] = coun1[j][i - 1];
    }
  }
  int m = 0;
  cin >> m;
  while (m--) {
    int l = 0, r = 0;
    cin >> l >> r;
    if (l == r) {
      cout << "Yes" << endl;
      continue;
    }
    int ans1 = 0;
    l--, r--;
    for (int i = 1; i <= 26; ++i) {
      if (coun1[i][r] - coun1[i][l - 1] > 0) ans1++;
    }
    if (ans1 >= 3)
      cout << "Yes" << endl;
    else if (in1[l] == in1[r])
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}
