program minpro2019
  integer i, a(6), c(4)
  read *, a
  do i = 1, 4
     c(i) = count(a == i)
  end do
  if (all(c < 3)) then
     print *, 'YES'
  else
     print *, 'NO'
  end if
end program minpro2019
