import scala.io.StdIn.readLine

object Main extends App {
    val string: String = readLine()
    val distinctString:String = string.toSeq.distinct.toString()

    val result = if (distinctString.length == 2) "Yes" else "No"

    println(result)
}
