import java.util.Scanner

object Main{
  val sc = new Scanner(System.in)

  def main(srgs: Array[String]):Unit ={

    val a = List.fill(6)(sc.nextInt)

    val t =
      a.foldLeft((0,0,0,0)) { (tuple, acc) =>
        acc match {
          case 1 => (tuple._1 + 1, tuple._2, tuple._3, tuple._4)
          case 2 => (tuple._1, tuple._2 + 1, tuple._3, tuple._4)
          case 3 => (tuple._1, tuple._2, tuple._3 + 1, tuple._4)
          case 4 => (tuple._1, tuple._2, tuple._3, tuple._4 + 1)
        }
    }

    val res = t._1 * t._2 * t._3 * t._4
    println( if( res == 4) "YES" else "NO")

 }
}