import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc: Scanner = new Scanner(System.in)
    val n = sc.nextLine.split("")
    if (n.distinct.length > 2) println("No")
    else if (n.distinct.length == 1) println("Yes")
    else if (n.head == n.last) println("No")
    else println("Yes")
  }
}
