fun main(args: Array<String>) {
    val roadMap = mutableMapOf<Int, Int>()
    repeat(3) {
        val (a, b) = readIntegerList()
        roadMap[a] = if (roadMap[a] == null) 1 else roadMap[a]!! + 1
        roadMap[b] = if (roadMap[b] == null) 1 else roadMap[b]!! + 1
    }
    
    for (i in roadMap.values) {
        if (i == 3) {
            println("NO")
            return
        }
    }
    println("YES")
}

fun readInteger() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)
