#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 2e5 + 100;
char s[N];
int dp[N][30];
int main() {
  scanf("%s", s + 1);
  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']++;
  }
  int m;
  scanf("%d", &m);
  while (m--) {
    int l, r, cnt = 0;
    scanf("%d%d", &l, &r);
    for (int i = 0; i < 26; i++)
      if (dp[r][i] - dp[l - 1][i]) cnt++;
    if (l == r || s[l] != s[r] || cnt >= 3)
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
