object Main extends App {
  val sc = new java.util.Scanner(System.in)
  var a = Array.fill(6)(sc.nextInt())
  var b = Array.fill(4)(0)
  for (i <- 0 until 6){
    b(a(i)-1) += 1
  }
  println(if(b.max >= 3) "No" else "Yes")
}
