#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 100;
int dp[maxn][30];
char s[maxn];
int main() {
  scanf("%s", s + 1);
  memset(dp, 0, sizeof(dp));
  int len = strlen(s + 1);
  for (int i = 1; i <= len; i++) {
    for (int j = 0; j < 26; j++) {
      dp[i][j] = dp[i - 1][j];
    }
    dp[i][s[i] - 'a'] += 1;
  }
  int T;
  cin >> T;
  while (T--) {
    int l;
    int r;
    scanf("%d%d", &l, &r);
    if (l == r) {
      printf("Yes\n");
      continue;
    } else if (s[l] != s[r]) {
      printf("Yes\n");
      continue;
    } else {
      int sum = 0;
      for (int i = 0; i < 26; i++) sum += (dp[r][i] - dp[l - 1][i]) > 0 ? 1 : 0;
      if (sum >= 3)
        printf("Yes\n");
      else
        printf("No\n");
    }
  }
  return 0;
}
