import scala.math._
import scala.annotation._
import scala.collection._
import scala.collection.{mutable => mut}
import scala.util.control.Breaks.{breakable,break}

object Main {
  def main(args: Array[String]) {
    val sc = new java.util.Scanner(System.in)
    val pw = new java.io.PrintWriter(System.out)

    val routes = List.fill(3, 2)(sc.nextInt).map(_.sorted)

    val b = List(1, 2, 3, 4)
      .permutations
      .exists {
        case List(i, j, k, l) =>
          List(List(i, j), List(j, k), List(k, l), List(l, i))
            .map(_.sorted)
            .count(routes.contains _) == 3
      }

    println(if (b) "YES" else "NO")
  }
}