program b169b

implicit none
integer(16), allocatable :: a(:), t
integer :: i, n
 
t = 1.0
 
read *, n
 
allocate(a(1:n))
 read *, a(:)
 
do i= 1, n
 t = t * a(i)
end do
 
if (t > 1.0 ** 18.0) then
 print *, -1
else
 print *, t
end if
 
end program b169b