program multi2
  implicit none

  integer(8), allocatable :: a(:)
  real(16), allocatable :: ar(:), b(:)
  integer(8) :: n, i, ans
  read(*,*) n

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

  if (product(a) == 0) then
     write(*,*) 0
  else
     
  do i = 1, n
     ar(i) = real(a(i),16)
     b(i) = log(ar(i))

  end do
  if (sum(b) > 18.0_16 * log(10.0_16)) then
     write(*,*) -1
  else
        ans = product(a)

        write(*,*) ans
  end if
end if

  deallocate(a, ar, b)

  
  stop
end program multi2



