program main
  implicit none

  integer(8), allocatable :: a(:)
  integer(8) :: n, i, ans

  read(*,*) n

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

  ans = 1
  do i = 1, n
     ans = ans * a(i)
  end do

  if (ans > 10**18) then
     write(*,*) -1
  else
     write(*,*) ans
  end if


end program main


