program main
      implicit none
      integer :: n, i
      integer(16) :: ans = 1
      integer(16), allocatable :: a(:)

      read *, n
      allocate(a(n))
      read *, a

      do i = 1, n
        if ( a(i) == 0 ) then
                print *, "0"
                stop
        end if
      end do

      do i = 1, n
        ans = ans * a(i)
        if ( ans > 10**18 ) then
                print *, "-1"
                stop
        end if
      end do
      print *, ans


end program main
