PROGRAM ATCODER

implicit none
integer :: w(6)
integer :: i, j, count(4), check1, check2

read(*,*) (w(i), i=1,6)

count = 0

do i = 1, 6
	do j = 1, 4
		if (w(i) == j) then
    		count(j) = count(j) + 1
		end if
    end do
end do

check1 = 0
check2 = 0
do i = 1, 4
  if (count(i) == 2) then
      check2 = check2 + 1
  else if (count(i) == 1) then
      check1 = check1 + 1
  end if
end do

if(check1 == 2 .and. check2 == 2) then
	write(*,'(a)') 'YES'
else
	write(*,'(a)') 'NO'
end if

END PROGRAM ATCODER
