fun main(args: Array<String>) {
    yahooProcon2019QualB()
}

fun yahooProcon2019QualB() {
    val abList = (1..3).map { readLine()!!.split(' ').map { it.toInt() } }

    val answer = if (abList.flatten().groupBy { it }.map { it.value.size }.sorted() == listOf(1, 1, 2, 2)) {
        "YES"
    } else "NO"

    println(answer)
}
