program test2
implicit none
integer :: n , i , num
integer(8) :: a

read *, n

num = 0
do i = 1 , n
 	read *, a
	num = num * a
 	if(num > 1e+18) then
    	print *,-1
    end if
end do

print *,num

end program test2
