fun main(args : Array<String>) {
        val l1 = mutableListOf<String>()
        val l2 = mutableListOf<String>()
        val l3 = mutableListOf<String>()
        var c1 = readLine()!!.split(" ").map { it.toInt() }
        var c2 = readLine()!!.split(" ").map { it.toInt() }
        var c3 = readLine()!!.split(" ").map { it.toInt() }
        (0..100).forEach {
            if (!c1.contains(-1)) {
                l1.add(c1.joinToString(""))
                c1 = listOf(c1[0] - 1, c1[1] - 1, c1[2] - 1)
            }
            if (!c2.contains(-1)) {
                l2.add(c2.joinToString(""))
                c2 = listOf(c2[0] - 1, c2[1] - 1, c2[2] - 1)
            }
            if (!c3.contains(-1)) {
                l3.add(c3.joinToString(""))
                c3 = listOf(c3[0] - 1, c3[1] - 1, c3[2] - 1)
            }
        }
        print(if (l1.intersect(l2).intersect(l3).isEmpty()) "No" else "Yes")
}