import java.util.regex.Pattern

import scala.io.StdIn._

object Main extends App {
  val S = readLine
  val Q = readInt
  def reduce(s: String): String = {
    var ss = s
    var m = Pattern.compile("(\\w)\\1").matcher(ss)
    while (m.find) {
      val l = m.group(0).head
      ss = ss.replaceFirst(m.group(0), if (l == 'z') "" else (l + 1).toChar.toString)
      m = Pattern.compile("(\\w)\\1").matcher(ss)
    }
    ss
  }
  for (i <- 1 to Q) {
    val ss = readLine.split(" ")
    println(if (reduce(S.substring(ss(0).toInt - 1, ss(1).toInt)).isEmpty) "Yes" else "No")
  }
}