program yahoo_procon_B
    implicit none
    integer::A,B,t(4)
    integer::i
    t=0
    do i=1,3
        read*,A,B
        t(A)=t(A)+1
        t(B)=t(B)+1
    end do
    print"(A)",trim(merge("YES","NO ",maxval(t)==2))
end program yahoo_procon_B