program pr2
  integer :: ab(3,2),i,j,pt(4)

  do i=1,3
     read(*,*) ab(i,:)
  enddo
  pt=0
  do i=1,3
     pt(ab(i,1))=pt(ab(i,1))+1
     pt(ab(i,2))=pt(ab(i,2))+1
  enddo
  j=0
  do i=1,4
     if(mod(pt(i),2).eq.1) then
        j=j+1
     endif
  enddo
  if(j.eq.2) then
     write(*,'(a)') 'YES'
  else
     write(*,'(a)') 'NO'
  endif
end program pr2
