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

  println(if (solve(readLine.trim, readLine.trim)) "yes" else "no")
  class Str(private val str: String) {
    private[this] val memo = ('a' to 'z').map(c ⇒ str.indices.map(i ⇒ if (str(i) == c) i else Int.MaxValue).toArray.also(a ⇒ a.indices.reverse.tail.foreach(i ⇒ a(i) = math.min(a(i), a(i + 1))))).toArray
    def nextSameCharPosition(index: Int): Int = {
      if (index + 1 < str.length) memo(str(index) - 'a')(index + 1)
      else str.length
    }
  }
  def solve(target: String, pattern: String): Boolean = {
    val str = new Str(target)
    val inverse = calLongestPattern(target, pattern)
    @tailrec
    def sub(current: Int, longest: Int = 0): Boolean = {
      if (current < target.length){
        if (longest < pattern.length){
          if (target(current) == pattern(longest)){
            if (str.nextSameCharPosition(current) < target.length){
              if (inverse(str.nextSameCharPosition(current)) + longest < pattern.length) sub(current + 1, longest + 1)
              else false
            }else sub(current + 1, longest + 1)
          }else sub(current + 1, longest)
        }else sub(current + 1, longest)
      }else longest == pattern.length
    }
    sub(0)
  }
  def calLongestPattern(str: String, pattern: String): Array[Int] = {
    val result = Array.tabulate(str.length){_ ⇒ 0}
    @tailrec
    def sub(current: Int, longest: Int = 0): Unit = {
      if (current >= 0){
        if (longest < pattern.length && str(current) == pattern(pattern.length - longest - 1)){
          result(current) = longest + 1
          sub(current - 1, longest + 1)
        }else {
          result(current) = longest
          sub(current - 1, longest)
        }
      }
    }
    sub(result.length - 1)
    result
  }
  implicit class Scope[T](val value: T) extends AnyVal {
    @inline def also(@inline func: T ⇒ Unit): T = {
      func(value)
      value
    }
    @inline def let[A](@inline func: T ⇒ A): A = func(value)
  }
}
