#include <bits/stdc++.h>
using namespace std;
int n, m, c[26][200127];
char sc[200127];
inline void change(int t, int x, int v) {
  for (; x <= n; x += x & (-x)) c[t][x] += v;
}
inline int Ask(int t, int x) {
  int res = 0;
  for (; x; x &= (x - 1)) res += c[t][x];
  return res;
}
int main() {
  scanf("%s", sc + 1);
  n = strlen(sc + 1);
  int i, l, r, cn = 0;
  for (i = 1; i <= n; i++) change(sc[i] - 'a', i, 1);
  scanf("%d", &m);
  while (m--) {
    scanf("%d%d", &l, &r);
    cn = 0;
    for (i = 0; i < 26; i++) cn += (Ask(i, r) > Ask(i, l - 1));
    if (cn == 1) {
      if (l == r)
        printf("Yes\n");
      else
        printf("No\n");
    } else if (cn == 2) {
      if (sc[l] == sc[r])
        printf("No\n");
      else
        printf("Yes\n");
    } else
      printf("Yes\n");
  }
  return 0;
}
