#include <bits/stdc++.h>
char s[200001];
int t, n, cnt, l, r, p[200001][26];
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 26; j++) p[i][j] = p[i - 1][j];
    p[i][s[i] - 'a']++;
  }
  for (scanf("%d", &t); t--; cnt = 0) {
    scanf("%d%d", &l, &r);
    for (int i = 0; i < 26; i++) cnt += p[l - 1][i] != p[r][i];
    if (r == l || s[l] != s[r] || cnt > 2)
      puts("Yes");
    else
      puts("No");
  }
}
