import java.util.Scanner

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val a1 = sc.nextInt()
    val b1 = sc.nextInt()
    val a2 = sc.nextInt()
    val b2 = sc.nextInt()
    val a3 = sc.nextInt()
    val b3 = sc.nextInt()

    // 同じ数字が3つか、出てきてない数字があったらアウト
    val list = listOf(a1, a2, a3, b1, b2, b3)
    val result = list.groupBy { it }
    if (existUnreachableCity(result)) {
        println("NO")
        return
    }
    if (existHubCity(result)) {
        println("NO")
        return
    }
    println("YES")
}

private fun existUnreachableCity(result: Map<Int, List<Int>>): Boolean {
    if (result.size != 4) {
        return true
    }
    return false
}

private fun existHubCity(result: Map<Int, List<Int>>): Boolean {
    val has = result.any { it.value.size == 3 }
    return has
}