program main
	implicit none
    integer(16)::ans
    integer(8)::n
    integer(16),allocatable::a
    read(*,*)n
    allocate(a(n))
    read(*,*)a
    ans=product(a)
    if(ans>10**18)then
    	write(*,*) -1
    else
    	write(*,*) ans
    end if
    deallocate(a)
    stop
end program main