import java.util.*

fun main(args: Array<String>){
    val sc:Scanner= Scanner(System.`in`)
    var a:Int
    var b:Int
    var ans=true
    var adj = arrayOf(0,0,0,0,0)
    for(i in 1..3){
        a=sc.nextInt()
        b=sc.nextInt()
        adj[a]++
        adj[b]++
    }
    for(i in 1..4){
        if(adj[i]==3 || adj[i]==0){
            ans=false
        }
    }
    if(ans) println("YES")
    else println("NO")

}