program main 
   implicit none
   integer::a(6),counter(4)=0
   integer i
   do i=1,3
      read(*,*)a(i*2-1),a(i*2)
   enddo
   do i=1,6
      counter(a(i))=      counter(a(i))+1
   enddo
   if(any(counter>=3))then
      print "(a)","NO"
   else
   print "(a)","YES"
   endif
end program main
