program path
  implicit none
  integer :: a, b, p(4,4), i
  p = 0
  do i = 1, 3
    read(*,*) a, b
    p(a,b) = 1
    p(b,a) = 1
  end do
  do i = 1, 4
    if (sum(p(i,:)).gt.2) then
      write(*,'(a)') "NO"
      stop
    end if
  end do
  write(*,'(a)') "YES"
  stop
end program path