object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val N = sc.next()
  println(N.toSeq.distinct.length match {
    case 1 => "Yes"
    case 2 if N.head != N.last => "Yes"
    case _ => "No"
  })
}
