object Main extends App {
  import scala.io.StdIn._

  val mod = 1000000007
  val s = readLine.trim
  implicit val memo = Array.tabulate(s.length){l ⇒ Array.tabulate(s.length - l){_ ⇒ -1L}}
  val chars = new CharIndex(s)
  println(
    ('a' to 'z').map{c ⇒
      (chars.nearestRight(c, 0), chars.nearestLeft(c, s.length - 1)) match{
        case (Some(l), Some(r)) ⇒ f(l, r, chars)
        case _ ⇒ 0
      }
    }.foldLeft(0L){case (l, r) ⇒ (l + r) % mod}
  )
  def f(exclusiveLeft: Int, exclusiveRight: Int, chars: CharIndex)(implicit memo: Array[Array[Long]]): Long = {
    if (memo(exclusiveLeft)(exclusiveRight - exclusiveLeft) == -1) {
      memo(exclusiveLeft)(exclusiveRight - exclusiveLeft) = if (exclusiveLeft == exclusiveRight) 1
      else ('a' to 'z').map {c ⇒
        (chars.nearestRight(c, exclusiveLeft + 1), chars.nearestLeft(c, exclusiveRight - 1)) match {
          case (Some(l), Some(r)) if l <= r ⇒ f(l, r, chars)
          case _ ⇒ 0
        }
      }.foldLeft(2L){case (l, r) ⇒ (l + r) % mod}
    }
    memo(exclusiveLeft)(exclusiveRight - exclusiveLeft)
  }
  class CharIndex(str: String) {
    private val nearestRightArray = ('a' to 'z').map(c ⇒ Array.tabulate(str.length){i ⇒ if (str(i) == c) i else - 1}.also{a ⇒
      for (i ← (1 until a.length).reverse){
        if (a(i - 1) == -1) a(i - 1) = a(i)
      }
    })
    private val nearestLeftArray = ('a' to 'z').map(c ⇒ Array.tabulate(str.length){i ⇒ if (str(i) == c) i else - 1}.also{a ⇒
      for (i ← (1 until a.length)){
        if (a(i) == -1) a(i) = a(i - 1)
      }
    })
    def nearestRight(char: Char, index: Int): Option[Int] = {
      nearestRightArray(char - 'a')(index) match {
        case i if i == -1 ⇒ None
        case i ⇒ Some(i)
      }
    }
    def nearestLeft(char: Char, index: Int): Option[Int] = {
      nearestLeftArray(char - 'a')(index) match {
        case i if i == -1 ⇒ None
        case i ⇒ Some(i)
      }
    }
    def includeChatType(exclusiveLeft: Int, exclusiveRight: Int): Int = {
      nearestLeftArray.count(a ⇒ a(exclusiveRight) > exclusiveLeft)
    }
  }
  implicit class ScopeFunc[T](value: T){
    def let[A](func: T ⇒ A): A = func(value)
    def also(func: T ⇒ Unit): T = {
      func(value)
      value
    }
  }
}
