#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
string s;
int nxt[N], pre[N];
int un[N];
int q;
int main() {
  cin >> s;
  for (int i = s.size() - 1; i >= 0; i--)
    if (i == s.size() - 1 || s[i] != s[i + 1])
      nxt[i] = i;
    else
      nxt[i] = nxt[i + 1];
  for (int i = 0; i < s.size(); i++)
    if (i == 0 || s[i] != s[i - 1])
      pre[i] = i;
    else
      pre[i] = pre[i - 1];
  for (int i = s.size() - 1; i >= 0; i--)
    if (i != s.size() - 1 && (s[i] == s[i + 1] || nxt[i + 1] + 1 == s.size() ||
                              s[nxt[i + 1] + 1] == s[i]))
      un[i] = un[i + 1];
    else if (i != s.size() - 1)
      un[i] = nxt[i + 1];
    else
      un[i] = i;
  cin >> q;
  while (q--) {
    int l, r;
    cin >> l >> r;
    l--;
    r--;
    if (un[l] >= r && l != r && s[l] == s[r])
      puts("No");
    else
      puts("Yes");
  }
  return 0;
}
