#include <bits/stdc++.h>
using namespace std;
long long n, m, ans, mid, mn, mx, T, sum, h1, h2, e[1234567], b[1234567],
    c[1234567], d[1 << 20], k, i, j, l, r, h, a[1234567], w, x, y, z, res,
    par[1234567], cnt, sz[1234567];
bool used[1234567];
vector<long long> v[1234567], vec1;
string s1, s;
vector<pair<long long, long long> > vp[1234567];
bool ok;
long long cc[323456][30];
set<long long> st;
int main() {
  cin >> s;
  for (long long k = 0; k <= s.size() - 1; k++) {
    i = k + 1;
    for (long long j = 'a' - 'a'; j <= 'z' - 'a'; j++) cc[i][j] = cc[i - 1][j];
    cc[i][s[k] - 'a']++;
  }
  cin >> T;
  while (T--) {
    cin >> l >> r;
    long long cnt = 0;
    for (long long j = 'a' - 'a'; j <= 'z' - 'a'; j++) {
      if (cc[l - 1][j] != cc[r][j]) cnt++;
    }
    if (cnt > 2 || s[l - 1] != s[r - 1] || l == r)
      puts("Yes");
    else
      puts("No");
  }
}
