import java.util.*
 
fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val count = Array(4) {0}
    repeat(3) {
        count[sc.nextInt() - 1]++
        count[sc.nextInt() - 1]++
    }
    var isNo = false
    var oddCount = 0
    for (x in count) {
        if (x == 0) {
            isNo = true
            break
        }
        if (x % 2 == 1) {
            oddCount++
        }
    }
    if (isNo || oddCount != 0 && oddCount != 2) {
        println("NO")
    } else {
        println("YES")
    }
}