program main
  implicit none
  integer :: n
  integer(16), allocatable :: an(:)
  integer :: i
  integer(16) :: threshold, ans
  logical :: flag
  threshold = 1

  do i = 1, 18
    threshold = threshold * 10
  enddo

  read *, n
  allocate(an(n))
  read *, an(1:n)

  if (minval(an) == 0)then
    print "(i0)", 0
  else

    flag = .true.
    ans = 1
    do i = 1, n
      ans = ans * an(i)
      if (ans > threshold)then
        flag = .false.
        exit
      endif
    enddo

    if (flag)then
      print "(i0)", ans
    else
      print "(i0)", -1
    endif
  endif
end program