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.0E18) then
 print *, -1
else
 print '(I18)', t
end if

end program b169b