fun main(args : Array<String>) {
    val towns = IntArray(4){0}

    repeat(3) {
        val (a, b) = readLine()!!.split(" ").map { it.toInt() }
        towns[a-1]++
        towns[b-1]++
    }

    println(if (towns.find { it > 2 } == null) "YES" else "NO")
}