program main
	implicit none
    long N, i, Ans, top
    integer(8),allocatable::A(:)
    read(*,*)N
    allocate(A(1:N))
    read(*,*)A
    Ans = 1
    do i=1,N
    	Ans = Ans * A(i)
    end do
    if (Ans>10**18) then
    	Ans = -1
    end if
    write(*,*)Ans
end program main