fun main(args: Array<String>) {
    val cnt = IntArray(4)
    readLine()!!.split(' ').forEach { cnt[it.toInt() - 1]++ }
    readLine()!!.split(' ').forEach { cnt[it.toInt() - 1]++ }
    readLine()!!.split(' ').forEach { cnt[it.toInt() - 1]++ }
    var even = 0
    var odd = 0
    for (c in cnt) {
        if (c % 2 == 0) {
            even++
        } else {
            odd++
        }
    }
    println(if (odd == 0 || odd == 2) "YES" else "NO")
}
