import io.{StdIn => in}

object Main extends App {
  val a = Iterator.continually(in.readLine)
    .take(3)
    .map(_.split(" ").map(_.toInt))
    .toArray
  val t = Array.ofDim[Int](5)
  
  a.foreach(e => {
    t(e(0)) += 1
    t(e(1)) += 1
  })

  val ans = if(!t.exists(_ > 2)) "YES" else "NO"
  println(ans)
}
