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


  val edges = Array.tabulate(3){_ ⇒
    val Array(a, b) = readLine.trim.split(' ').map(_.toInt)
    (a, b)
  }
  val count = (1 to 4).map(i ⇒ edges.count(it ⇒ it._1 == i || it._2 == i))
  println(
    if (count.count(_ == 2) == 2 && count.count(_ == 1) == 2) "YES"
    else "NO"
  )
  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)
  }
}