program main
	implicit none
    integer N, i, Ans
    integer,allocatable::A(:)
    read(*,*)N
    allocate(A(1:N))
    read(*,*)A
    Ans = 1
    do i=1,N
    	Ans = Ans * A(i)
    end do
    if ((log(real(Ans))>18).or.(Ans==0)) then
    	Ans = -1
    end if
    write(*,*)Ans
end program main