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
    	s = s * a(i)
    end do 
    if (s > 10_8**18) then
        write(*,*) -1
        stop
    else
    	write(*,*) s
    end if

    deallocate(a)
	stop
end program kk