#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
const int mod = 998244353;
const int inf = 1e9;
const double eps = 1e-16;
const double pi = acos(-1);
inline int read() {
  int p = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f *= -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    p = p * 10 + ch - '0';
    ch = getchar();
  }
  return p * f;
}
char s[N];
int cnt[N][27];
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  for (int i = 1; i <= n; i++) {
    cnt[i][s[i] - 'a' + 1]++;
    for (int j = 1; j <= 26; j++) cnt[i][j] += cnt[i - 1][j];
  }
  int q = read();
  while (q--) {
    int l = read();
    int r = read();
    int c = 0;
    for (int i = 1; i <= 26; i++)
      if (cnt[r][i] - cnt[l - 1][i]) c++;
    if (c == 2 && s[l] == s[r])
      puts("No");
    else if (c == 1 && l != r)
      puts("No");
    else
      puts("Yes");
  }
  return 0;
}
