program b169b

implicit none
integer(8), allocatable :: a(:)
integer(8) :: b, c, t
integer :: i, n
 
t = 1.0
b = 1000000000
c = 1000000000

read *, n
 
allocate(a(1:n))
 read *, a(:)
 
do i= 1, n
 t = t * a(i)
end do

if (t <= b * c) then
 print *, t
else
 print *, -1
end if
 
end program b169b