#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-18;
const double DEPS = 1e-9;
const long double PI = 3.141592653589793238;
const long long MOD = 1000000007;
const int N = (int)(5e5) + 10;
void inp() {}
void out() {}
long long gcd(long long fx, long long fy) {
  if (!fy) return fx;
  return gcd(fy, fx % fy);
}
inline void fill(int* ar, int sz, int val) {
  for (int i = 0; i < sz; i++) {
    ar[i] = val;
  }
}
int q, fr[N][26];
string x;
int main() {
  inp();
  cin >> x >> q;
  for (int i = 0; i < x.size(); i++) {
    fr[i][x[i] - 'a'] = 1;
    if (!i) continue;
    for (int j = 0; j < 26; j++) {
      fr[i][j] += fr[i - 1][j];
    }
  }
  while (q--) {
    int l, r;
    scanf("%d%d", &l, &r);
    l--, r--;
    int cnt = 0;
    for (int i = 0; i < 26; i++) {
      if (l)
        cnt += (fr[l - 1][i] < fr[r][i]);
      else
        cnt += (fr[r][i] > 0);
    }
    if (cnt > 2 || l == r || x[l] != x[r]) {
      puts("Yes");
    } else {
      puts("No");
    }
  }
}
