import java.util.*

fun main(args: Array<String>) {
    Scanner(System.`in`).use {
        val m = mutableMapOf(7 to 1, 5 to 2)
        var r = "YES"
        for (i in 1..3) {
            val x = it.nextInt()
            val c = m[x]
            if (c != null && c > 0) {
                m[x] = c - 1
            } else {
                r = "NO"
                break
            }
        }
        println(r)
    }
}
