program kk
	implicit none
    integer(8), allocatable :: a(:)
    integer(8) :: n, i
    integer(8) :: s
    read(*,*) n
    allocate(a(n))
    read(*,*) a
    s = 1
    do i = 1, n
     if (a(i) == 0) then
        write(*,*) 0
        stop
     end if
 	end do
    do i = 1, n
    	s = s * a(i)
    	if (s > 10_8**18) then
        	write(*,*) -1
        	stop
        end if
    end do
    
    write(*,*) s

    deallocate(a)
	stop
end program kk