program answer
  implicit none

  integer(16), allocatable :: A(:)
  integer(16) :: ans, N, i

  read(*,*) N
  allocate(A(N))
  read(*,*) (A(i), i=1,N)
  ans=1_16
 do i = 1, N
     if	(A(i)==0) then
	write(*,*) 0
      	stop
     end if
  end do

  do i = 1, N
     ans = A(i)*ans
  if (ans>10_16**18) then
      ans = -1
     stop
   end do
    end if
  write(*,*) ans

  deallocate(A)
  stop
end program answer
